2025-07-13 23:16:20 +08:00
|
|
|
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();
|
2025-07-23 01:36:18 +08:00
|
|
|
player.GetComponent<UMPTool>().Init();
|
2025-07-13 23:16:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
foreach (UniversalMediaPlayer player in opation.ump)
|
|
|
|
{
|
|
|
|
player.Stop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
public struct UMPOpation {
|
|
|
|
public string name;
|
|
|
|
public List<UniversalMediaPlayer> ump;
|
|
|
|
}
|