Exemple #1
0
 private void Destroy()
 {
     if (Destroyable)
     {
         Destroyable.DestroySelf();
     }
 }
    void OnTriggerEnter(Collider other)
    {
        Debug.Log(name + "DestroyOnTriggerComp::OnTriggerEnter()");

        if (DestroyableComp)
        {
            DestroyableComp.DestroySelf();
        }
        else
        {
            Destroy(gameObject);
        }
    }
Exemple #3
0
 private void HandleHealthChange(uint newHealth)
 {
     if (newHealth == 0)
     {
         if (DestroyableComp)
         {
             DestroyableComp.DestroySelf();
         }
         else
         {
             Destroy(gameObject);
         }
     }
 }