Example #1
0
 void Singleton()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else
     if (_instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Example #2
0
 void Start()
 {
     _gm  = transform.parent.GetComponentInChildren <_GameManager>();
     _GUI = _gm._GUI;
 }