예제 #1
0
 protected virtual void OnDisable()
 {
     if (!Application.isPlaying)
     {
         ObjectChangeState?.Invoke(this, false);
     }
     else if (activeObjects != null)
     {
         if (activeObjects.Remove(this))
         {
             ObjectChangeState?.Invoke(this, false);
         }
     }
 }
예제 #2
0
 protected virtual void OnEnable()
 {
     if (!Application.isPlaying)
     {
         ObjectChangeState?.Invoke(this, false);
     }
     else
     {
         GetActiveObjects();
         if (!activeObjects.Contains(this))
         {
             activeObjects.Add(this);
             ObjectChangeState?.Invoke(this, true);
         }
     }
 }