void Awake() { Instance = this; m_audioSource = GetComponent<AudioSource>(); InitAudioSource(); SoundManager.Instance.ChangedSound += new OnSound(ChangeSound); }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
void Awake() { bgAudio.gameObject.GetComponent <AudioSource>(); if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
public void PlayBGSound(BGSound _BGSound) { StopCoroutine("PlaySoundBGRoutine"); audioSources[0].clip = backGroundClips[(int)_BGSound]; StartCoroutine("PlaySoundBGRoutine"); }