// Use this for initialization
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
         Destroy(this);
     }
Beispiel #2
0
 void _MakeSingleInstance()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         //DontDestroyOnLoad(gameObject);
     }
 }