// Use this for initialization void Start() { if (instance == null) { instance = this; music.Play(); DontDestroyOnLoad(gameObject); } else Destroy(gameObject); }
void Awake() { if (instant != null) { Destroy(gameObject); } else { instant = this; GameObject.DontDestroyOnLoad(gameObject); } }
// Use this for initialization void Start() { if (instance == null) { instance = this; music.Play(); DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }