Пример #1
0
 private void Awake()
 {
     if (m_instance == null)
     {
         m_instance = this;
     }
     else if (m_instance != this)
     {
         Debug.LogWarning("IGMenu.Awake() - instance already exists!");
         Destroy(gameObject);
     }
 }
Пример #2
0
 private void OnDestroy()
 {
     m_instance = null;
 }
Пример #3
0
 void Start()
 {
     instance = this;
 }