Example #1
0
 //
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(gameObject);
     }
     instance = this;
     DontDestroyOnLoad(gameObject);
 }
 //
 void Awake()
 {
     if (instance != null && instance != this) {
         Destroy (gameObject);
     }
     instance = this;
     DontDestroyOnLoad (gameObject);
 }