public DamageInfo(float damage, DamageMatrix.Damage type, Vector3 point, Vector3 direction) { Damage = damage; Type = type; Point = point; Direction = direction; }
public void DoDamage(IDamagable damagable, float damage, DamageMatrix.Damage type, Vector3 point, Vector3 direction) { if (damagable != null) { if (damagable.TakeDamage(new DamageInfo(damage, type, point, direction)) <= 0f) { OnKill?.Invoke(this, damagable); } } }