Exemple #1
0
 void OnDisable()
 {
     if (_inst == this)
     {
         _inst = null;
     }
 }
Exemple #2
0
 void OnDestroy()
 {
     if (_inst == this)
     {
         _inst = null;
     }
     DestroyRenderTextures();
 }
Exemple #3
0
 void OnEnable()
 {
     if (_inst != null)
     {
         Debug.LogError("Duplicated " + GetType() + ". Destroy this " + gameObject.name);
         GameObject.Destroy(this);
         return;
     }
     _inst = this;
     CreateRenderTextures();
 }