public void Initialize(Vector3 dir, States.Player from) { m_owner = from; m_movingDirection = dir; transform.forward = dir; Rigidbody.AddForce(dir * Force, ForceMode); Destroy(gameObject, LifeTime); }
public void ApplyDamage(float amount, States.Player from) { CurrentHealth = Mathf.Clamp(CurrentHealth -= amount, 0, MaxHealth); OnHealthChanged.Invoke(CurrentHealth, MaxHealth); if (CurrentHealth <= 0) { OnDeath(); } }