Example #1
0
        public override void Update()
        {
            if (!isCurrentState || !stateMachineEnabled)
            {
                return;
            }

            if (!_closeEnough)
            {
                _npcLocomotionController.StartMove();
                _npcLocomotionController.Move(_target.position);
            }
            else
            {
                _npcLocomotionController.Stop();

                if (CanAttack)
                {
                    SwitchState(_attackState.GetType());
                }
            }
        }
Example #2
0
 public override void Exit()
 {
     _locomotionController.Stop();
 }