private void Destroy() { if (Destroyable) { Destroyable.DestroySelf(); } }
void OnTriggerEnter(Collider other) { Debug.Log(name + "DestroyOnTriggerComp::OnTriggerEnter()"); if (DestroyableComp) { DestroyableComp.DestroySelf(); } else { Destroy(gameObject); } }
private void HandleHealthChange(uint newHealth) { if (newHealth == 0) { if (DestroyableComp) { DestroyableComp.DestroySelf(); } else { Destroy(gameObject); } } }