void Awake() { if (Instance != null && Instance != this) { Destroy(gameObject); return; } Instance = this; DontDestroyOnLoad (gameObject); }
private void Start() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
void Awake() { if (!instance) { instance = this; } else { Destroy(this.gameObject); } DontDestroyOnLoad(this.gameObject); }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this.gameObject); return; } }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; DontDestroyOnLoad(gameObject); } }
void Awake() { DontDestroyOnLoad(this); if (multitonInstance == null) { multitonInstance = this; } else { Destroy(gameObject); } }
void Awake() { if (Instance) // PRevents creation of camera clones when loading new level { Destroy(gameObject); } else { DontDestroyOnLoad(gameObject); Instance = this; } }
private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this); } else { Destroy(gameObject); } }
void Awake() { if (instance == null) { instance = this; // In first scene, make us the singleton. DontDestroyOnLoad(gameObject); } else if (instance != this) { Destroy(gameObject); // On reload, singleton already set, so destroy duplicate. } }
void Awake() { if (Instance == null) { DontDestroyOnLoad(gameObject); Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
private void Awake() { DontDestroyOnLoad(this); if (dontDestroy == null) { dontDestroy = this; } else { Destroy(this.gameObject); } }
public void SetSingleton() { if (instance == null) { instance = this; DontDestroyOnLoad(this); } else if (instance != this) { DestroyImmediate(gameObject); } }
void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } }
void Start() { if(Instance != null) { GameObject.Destroy(gameObject); } else { DontDestroyOnLoad(gameObject); Instance = this; } }
void Awake() { if (Instance) { DestroyImmediate(gameObject); } else { DontDestroyOnLoad(gameObject); Instance = this; } }
private void Awake() { if (instanceRef == null) { instanceRef = this; DontDestroyOnLoad(gameObject); } else if (instanceRef != this) { Destroy(gameObject); } }
// Start is called before the first frame update void Start() { DontDestroyOnLoad(this); if (obj == null) { obj = GetComponent <DontDestroyOnLoad>(); } else { Destroy(gameObject); } }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
void Awake() { DontDestroyOnLoad(this); if (dontDestroyOnLoad == null) { dontDestroyOnLoad = this; } else { Destroy(gameObject); } }
private void Awake() { if (Instance != null) { Debug.Log($"There were multiple Instances of {this} in the scene. Deleting {name}"); Destroy(gameObject); return; } Instance = this; DontDestroyOnLoad(this); }
// Use this for initialization void Awake() { if (control == null) { DontDestroyOnLoad(gameObject); control = this; } else if (control != null) { Destroy(gameObject); } DontDestroyChildOnLoad(this.gameObject); }
private void Awake() { if (instance != null) { Destroy(this.gameObject); } else { instance = this; transform.SetParent(null); DontDestroyOnLoad(gameObject); } }
protected override void OnAwake() { if (_instance == null) { DontDestroyOnLoad(gameObject); _instance = this; } if (_instance == this) { return; } Destroy(gameObject); }
void Awake() { DontDestroyOnLoad(this); if (gameComponent == null) { gameComponent = this; } else { DestroyImmediate(this); } }
// Start is called before the first frame update private void Awake() { if (estadoJuego == null) { estadoJuego = this; DontDestroyOnLoad(gameObject); PlayGamesPlatform.Activate(); PlayGamesPlatform.DebugLogEnabled = false; //OJO desactivar al finalizar } else if (estadoJuego != this) { Destroy(gameObject); } }
void Awake() { if (!created) { DontDestroyOnLoad(this.gameObject); created = true; thisAudio = this; } else { Destroy(this.gameObject); thisAudio.Start(); } }
// Use this for initialization void Awake() { if (instance != null) { Debug.LogError("Erreur : Il y a plus d'un script DontDestroyOnLoad dans la scène."); Destroy(gameObject); } else { instance = this; } DontDestroyOnLoad(gameObject); }
//------------------------------------ private void Awake() { //para que no haya mas de un audio manager en la escena if (instance == null) { instance = this; } else { Destroy(gameObject); return; } //----------------------------------------------------- DontDestroyOnLoad(gameObject); }
void Awake() { if (_instance == null) { _instance = this; DontDestroyOnLoad(this); } else { if (this != _instance) { Destroy(this.gameObject); } } }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); audioSource = GetComponent <AudioSource>(); }