Esempio n. 1
0
 void Awake()
 {
     if(instance!=null){
         DestroyImmediate(gameObject);
     }else{
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
 void Awake()
 {
     if (instance != null)
     {
         DestroyImmediate(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }