void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } }
// Use this for initialization void Start() { if (instance != null) { Destroy(gameObject); print("Dubbele muziekspeler gedetecteerd! Start zelfvernietiging!"); } else { instance = this; DontDestroyOnLoad(gameObject); } }
// Use this for initialization void Start() { if (instance != null) { Destroy(gameObject); print("Destroy Mankind"); } else { instance = this; DontDestroyOnLoad(gameObject); } MpPlayer.clip = MusicClip[0]; MpPlayer.Play(); }