2023-09-27 23:28:03 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Mono.Event;
|
|
|
|
|
using Script;
|
|
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace UnityTest.ZXL
|
|
|
|
|
{
|
|
|
|
|
public class AudioLogicManager : SerializedMonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
// [ShowInInspector] private Dictionary<string, AudioClip> dictionary = new Dictionary<string, AudioClip>();
|
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
EventManager.Instance.Subscribe(AudioEventArgs.EventId, AudioEvent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnDestroy()
|
|
|
|
|
{
|
|
|
|
|
EventManager.Instance.Unsubscribe(AudioEventArgs.EventId, AudioEvent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void AudioEvent(object sender, GameEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var args = e as AudioEventArgs;
|
2023-10-05 02:31:29 +08:00
|
|
|
|
var str = $"{args.audioName}";
|
2023-09-27 23:28:03 +08:00
|
|
|
|
AudioManager.Instance.PlayMainSounds(str);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|