Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (Activations == 0)
     {
         if (_MetaObjectPool != null)
         {
             _MetaObjectPool.Deactivate(this.gameObject);
         }
         else
         {
             Destroy(this.gameObject);
         }
     }
 }
Example #2
0
 // Update is called once per frame
 void Update()
 {
     TimerLifetime += Time.deltaTime;
     if (TimerLifetime > Lifetime)
     {
         if (_MetaObjectPool != null)
         {
             _MetaObjectPool.Deactivate(this.gameObject);
         }
         else
         {
             Destroy(this.gameObject);
         }
     }
 }
Example #3
0
    IEnumerator Kill()
    {
        if (DeathAnimationTime != 0)
        {
            yield return(new WaitForSeconds(DeathAnimationTime));
        }

        if (_MetaObjectPool != null)
        {
            _MetaObjectPool.Deactivate(this.gameObject);
        }
        else
        {
            Destroy(this.gameObject);
        }
    }