private void HandleHit(object sender, HitEventArgs eventArgs) { if (eventArgs.Amount > 50) { animator.SetBool("SentFlying", true); } }
/// <summary> /// Triggers the Hit Event. /// </summary> protected virtual void OnHit(int amount) { Debug.Log("Hit"); animator.SetBool("isHit", true); var args = new HitEventArgs(); args.Amount = amount; Hit?.Invoke(this, args); }