예제 #1
0
 public virtual void OnDisable()
 {
     if (UsesUpdate())
     {
         PooledUnityCalls.RemoveUpdate(this);
     }
 }
예제 #2
0
 public virtual void OnEnable()
 {
     if (UsesUpdate())
     {
         PooledUnityCalls.AddUpdate(this);
     }
 }
    private void Awake()
    {
        if (instance != null)
        {
            Debug.LogError("Multiple instances of singleton! Destroying offending component.");
            Destroy(this);
            return;
        }

        instance = this;
    }