protected override void Awake() { base.Awake(); DontDestroyOnLoad(this.gameObject); if (instance == null) { instance = this; } else { Destroy(this.gameObject); return; } sfxQueue = new List <SFX>(); }
void Start() { if (instance == null) { instance = this; } else if (instance != this) { //잘못된 인스턴스를 가르키고 있을 경우 Destroy(gameObject); } DontDestroyOnLoad(this); myAudio = transform.Find("SFX").GetComponent <AudioSource>(); StartCoroutine(StopSFXSound()); }
public void OnDestroy() { GlobalSFX.Play(GlobalSFX.SFX.Pickup); }
public void OnDestroy() { GlobalSFX.Play(7); }