Beispiel #1
0
 private void HandleHit(object sender, HitEventArgs eventArgs)
 {
     if (eventArgs.Amount > 50)
     {
         animator.SetBool("SentFlying", true);
     }
 }
Beispiel #2
0
        /// <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);
        }