/// <summary>
        /// Event when exiting a state
        /// </summary>
        public void OnStateExit(CharacterState state, CharacterState toState)
        {
            switch (state)
            {
            case CharacterState.Default:
            {
                break;
            }

            case CharacterState.Dying:
            {
                break;
            }

            case CharacterState.Revive:
            {
                CharacterAnimator.SetBool("Revive", false);
                break;
            }

            case CharacterState.Pause:
            {
                // Hide UI
                OnChangeUI?.Invoke(-1);
                break;
            }
            }
        }
        /// <summary>
        /// Event when entering a state
        /// </summary>
        public void OnStateEnter(CharacterState state, CharacterState fromState)
        {
            // TODO: move animations to AfterUpdate method
            switch (state)
            {
            case CharacterState.Default:
            {
                OnChangeUI?.Invoke(1);
                break;
            }

            case CharacterState.Dying:
            {
                _moveInputVector = Vector3.zero;
                CharacterAnimator.SetFloat("Forward", 0.0f);
                if (HitFront)
                {
                    CharacterAnimator.SetTrigger("DieBack");
                }
                else
                {
                    CharacterAnimator.SetTrigger("DieForward");
                }
                break;
            }

            case CharacterState.Revive:
            {
                _moveInputVector = Vector3.zero;
                CharacterAnimator.SetTrigger("Revive");
                break;
            }

            case CharacterState.Pause:
            {
                // Stop the player
                _moveInputVector = Vector3.zero;
                CharacterAnimator.SetFloat("Forward", 0.0f);
                CharacterAnimator.SetBool("Crouch", false);

                break;
            }
            }
        }