Exemple #1
0
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
         return;
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Exemple #2
0
 // Start is called before the first frame update
 void Awake()
 {
     if (INSANCE == null)
     {
         INSANCE   = this;
         bestScore = 0;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }