private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
private void Awake() { if (instance == null) { instance = this; } sceneAudioClip = new Dictionary <int, AudioClip>(); foreach (AudioClipMatch acm in audioClipMatch) { sceneAudioClip.Add(acm.sceneIndex, acm.audioClip); } }