private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
private void Awake() { if (Instanciado2 == null) { Instanciado2 = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
// Use this for initialization void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }