public IEnumerator Action()
        {
            rotation.TurnToNearest(navigation.targetDirection);
            yield return(new WaitForSeconds(rotationWaitTime));

            movement.MoveForwardByDistance(gridSize);
            yield return(new WaitForSeconds(moveWaitTime));
        }
Beispiel #2
0
        public IEnumerator Action()
        {
            var rotationWait = new WaitForSeconds(rotationWaitTime);
            var lungeWait    = new WaitForSeconds(movement.duration);
            var attackWait   = new WaitForSeconds(waitInLunge);

            rotation.TurnToNearest(navigation.targetDirection);
            yield return(rotationWait);

            movement.SetStartAtSelf();
            movement.MoveForwardByDistance(lungeDistance);
            yield return(lungeWait);

            yield return(attackWait);

            movement.MoveForwardByDistance(-lungeDistance);
            yield return(lungeWait);
        }