Exemple #1
0
        public override void Enter()
        {
            _wayPointIndex = 0;

            _locomotionController.StartMove();
            _locomotionController.Move(_wayPoints[_wayPointIndex].position);
        }
Exemple #2
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());
                }
            }
        }