protected override void OnCollision(Collision collision) { LivingEntity entity = collision.gameObject.GetComponentInParent <LivingEntity>(); if (entity != null) { if (!entitiesTouched.Contains(entity)) { InflictDamage(entity); entitiesTouched.Add(entity); } } else { if (dieOnCollision) { Die(); } } if (instability >= 3 && entitiesTouched.Count >= 2) { Die(); } }
protected override void InflictDamage(LivingEntity entity) { entity.TakeDamage(heading, damage); }
protected abstract void InflictDamage(LivingEntity entity);