private void OnCollision(Entity entity) { if (spawned) { EntityCreature creature = entity as EntityCreature; if (creature != null && creature != _owner) { creature.ApplyDamage(_damage); Hit(); } } }
private void EffectEntity(Entity entity) { Vector3 delta = entity.worldPosition - _position; if (entity.physics != null) { entity.physics.AddForce(delta.normalized * _power / delta.magnitude); } EntityCreature creature = entity as EntityCreature; if (creature != null) { creature.ApplyDamage(new Damage(entity, _power / delta.magnitude)); } }