Пример #1
0
 void OnDestroy()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         gameObject.SetActive(false);
     }
 }