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