void Awake() { if (_instance == null) { //Create first instance. _instance = this; DontDestroyOnLoad(this); } else { //Destroy any duplicates attempting to occur. if (this != _instance) Destroy(this.gameObject); } }
public void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this); } foreach (AudioListener aD in FindObjectsOfType <AudioListener>()) { print(aD.name); } }
void Awake() { if (_instance == null) { //Create first instance. _instance = this; DontDestroyOnLoad(this); } else { //Destroy any duplicates attempting to occur. if (this != _instance) { Destroy(this.gameObject); } } }
private void Start() { sh = GetComponent <soundHandler>(); }