42 lines
942 B
C#
42 lines
942 B
C#
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UMP;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class UMPController : Singleton<UMPController>
|
||
|
{
|
||
|
public List<UMPOpation> Umps = new List<UMPOpation>();
|
||
|
private string Name;
|
||
|
|
||
|
public void UMPPlayer(string name) {
|
||
|
Name = name;
|
||
|
Invoke("Init", 0.1f);
|
||
|
}
|
||
|
|
||
|
void Init() {
|
||
|
foreach (UMPOpation opation in Umps)
|
||
|
{
|
||
|
if (opation.name == Name)
|
||
|
{
|
||
|
foreach (UniversalMediaPlayer player in opation.ump)
|
||
|
{
|
||
|
player.Play();
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
foreach (UniversalMediaPlayer player in opation.ump)
|
||
|
{
|
||
|
player.Stop();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
[Serializable]
|
||
|
public struct UMPOpation {
|
||
|
public string name;
|
||
|
public List<UniversalMediaPlayer> ump;
|
||
|
}
|