2025-11-25 08:19:33 -05:00
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using AK.Wwise;
|
|
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
|
using UnityEngine.Serialization;
|
|
|
|
|
|
2026-02-13 09:22:11 -05:00
|
|
|
namespace SLSUtilities.WwiseAssistance
|
2025-11-25 08:19:33 -05:00
|
|
|
{
|
|
|
|
|
public class BackgroundMusicManager : SerializedMonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public Dictionary<string, State> baseMusicDictionary; // 背景音乐事件字典
|
|
|
|
|
public Event playMusicEvent; // 播放背景音乐的事件
|
|
|
|
|
public Event stopMusicEvent; // 停止播放背景音乐的事件
|
|
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
|
{
|
|
|
|
|
PlayMusic("NormalMusic");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void PlayMusic(string musicStateName)
|
|
|
|
|
{
|
|
|
|
|
//if (baseMusicDictionary.ContainsKey(musicStateName))
|
|
|
|
|
{
|
|
|
|
|
stopMusicEvent.Post(gameObject);
|
|
|
|
|
//baseMusicDictionary[musicStateName].SetValue();
|
|
|
|
|
playMusicEvent.Post(gameObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void StopMusic()
|
|
|
|
|
{
|
|
|
|
|
stopMusicEvent.Post(gameObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|