private void Awake() { if (_instance != null) { Destroy(gameObject); } else { _instance = this; DontDestroyOnLoad(this); } }
// Use this for initialization void Start() { if (DontDestroyCanvas.Canvas == null) { Canvas = this; } else { Destroy(this.gameObject); } DontDestroyOnLoad(this.gameObject); }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(transform.gameObject); } else { Destroy(gameObject); } }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
void Awake() { if (dontDestroyCanvas == null) { DontDestroyOnLoad(gameObject); dontDestroyCanvas = this; } else { Destroy(gameObject); } }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
//Si rende non distruttibile al cambio di scena il canvas che contiene il text per visualizzare lo stato di connessione dell'Hololens void Awake() { DontDestroyOnLoad(this); if (playerInstance == null) { playerInstance = this; } else { DestroyObject(gameObject); } }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); }