// Use this for initialization void Start() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } if (instance != this) { Destroy(gameObject); } }
void Awake() { if (thisScript == null) { DontDestroyOnLoad(gameObject); thisScript = this; } else if (thisScript != this) { Destroy(gameObject); } }
void Awake() { if (!kol) { DontDestroyOnLoad(gameObject); kol = this; } else if (kol != this) { Destroy(gameObject); } }