protected virtual void DamageTarget(CharacterHealth health)
        {
            if (gameObject.CompareTag("Player") && health.CompareTag("Enemy"))
            {
                health.Health -= _damage;

                PlayerHitEnemy?.Invoke();

                StateMachineBrains brains = health.gameObject.GetComponentInChildren <StateMachineBrains>();
                if (brains != null)
                {
                    brains.IsShot = true;
                }
            }
            else if (gameObject.CompareTag("Enemy") && health.CompareTag("Player"))
            {
                health.Health -= _damage;
            }
        }
        private void Awake()
        {
            if (_settings.UseAI)
            {
                _brains = GetComponent <StateMachineBrains>();

                if (_brains == null)
                {
                    print("AI character doesn't have a StateMachine component.");
                }

                _input = new InputAI(_brains) as ICharacterInput;
            }
            else
            {
                _input = new InputPlayer() as ICharacterInput;
            }

            _movement = new GroundedCharacterMovement(GetComponent <CharacterController>(), _input,
                                                      transform, _pointOfView, _groundCheck, _settings, _initGravityDirection);
        }
 public InputAI(StateMachineBrains brains)
 {
     _brains = brains;
     Jump    = false;
 }