using System.Collections; using System.Collections.Generic; using UnityEngine; public class SoundPlayEvent_BGM : MonoBehaviour { public SoundPlayer spEnabled; public SoundPlayer spDisenabled; private void OnEnable() { if (spEnabled != null) SoundManager.Instance.BGMPlay(spEnabled.gameObject, true); } private void OnDisable() { if (spDisenabled != null && SoundManager.Instance != null) SoundManager.Instance.BGMPlay(spDisenabled.gameObject, false); } public void FadeOut(SoundPlayer soundPlayer) { SoundManager.Instance.BGMPlay(soundPlayer.gameObject, false); } }