public void OnTriggerEnter(Collider other) { BaseHealth health = other.GetComponentInParent <BaseHealth> (); if (health != null) { Debug.Log("Killing " + other.gameObject.name); health.KillSelf(); } }
private void SelfDestruct() { if (myHealth == null) { if (poolable == null) { Destroy(gameObject); } else { poolable.ReturnToPool(); } } else { myHealth.KillSelf(); } }