Exemple #1
0
 void Awake()
 {
     if(instance == null){
         instance = this;
         GameObject.DontDestroyOnLoad(this.gameObject);
     }
     else {
         Destroy (gameObject);
     }
 }
Exemple #2
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         GameObject.DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }