Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        public void ApplyDamage(float amount, States.Player from)
        {
            CurrentHealth = Mathf.Clamp(CurrentHealth -= amount, 0, MaxHealth);
            OnHealthChanged.Invoke(CurrentHealth, MaxHealth);

            if (CurrentHealth <= 0)
            {
                OnDeath();
            }
        }