void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
public override void OnAwake() { if(Instance == null) { Instance = this; } else { Debug.LogError("Warning multiple Game Music Managers!"); } base.OnAwake(); _audioSource = GameMainReferences.Instance.RTSCamera.GetComponent<AudioSource>(); samples = new float[qSamples]; }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); audioSource = GetComponent <AudioSource>(); }
void Awake() { instance = this; }