void Start() { if (instance == null) { instance = this; } bgMusic = GameObject.Find("BackgroundMusic"); bgMusic.GetComponent <AudioSource> ().Play(); music = GameObject.FindObjectOfType <DontDestroyMusic>(); UpdateIcon(); }
void Awake() { if (instanceRef == null) { instanceRef = this; DontDestroyOnLoad(transform.gameObject); } else { DestroyImmediate(gameObject); } }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } //dont destroy the music across scenes DontDestroyOnLoad(transform.gameObject); }
void Awake() { if (volumeControl != null && volumeControl != this) { Destroy(this.gameObject); return; } else { volumeControl = this; } DontDestroyOnLoad(this.gameObject); }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } GetComponent <AudioSource>().ignoreListenerPause = true; PauseSFX(); }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
void Start() { music = GameObject.FindObjectOfType <DontDestroyMusic>(); changeText(); }