void Awake() { if(Instance != null && Instance != this){ Destroy(gameObject); } Instance = this; DontDestroyOnLoad(gameObject); }
private void Awake() { if (InstanceSing == null) { InstanceSing = this; } else { Destroy(gameObject); } }
// Use this for initialization void Start() { if (self == null) { self = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; DontDestroyOnLoad(this.gameObject); } }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
// Use this for initialization void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(this.gameObject); }