Example #1
0
 public void TryChangeDirection(DirectionChange _directionChanger)
 {
     if (canTurn)
     {
         canTurn = false;
         StartCoroutine(ChangeCanTurnValueCR());
         Path nextPath = _directionChanger.GetConnectionFrom(entityReference.GetCurrentPath);
         // nextPathReference = nextPath;
         if (nextPath)
         {
             Vector3 currentDirection = entityReference.GetFollowPathComponent.GetCurrentDirection;
             Vector3 nextDirection    = nextPath.GetDirectionAt(nextPath.GetTParameter(transform.position));
             OnStartDirectionChangeArgs directionArgs = new OnStartDirectionChangeArgs
             {
                 CurrentDirection = currentDirection,
                 NextDirection    = nextDirection,
                 NextPath         = nextPath
             };
             onStartDirectionChange?.Invoke(directionArgs);
         }
     }
 }
Example #2
0
 private void OnStartDirectionChange(OnStartDirectionChangeArgs _args)
 {
     StartDirectional(_args.NextDirection);
 }
Example #3
0
 private void OnStartDirectionChange(OnStartDirectionChangeArgs _eventArgs)
 {
     CheckDirectional(_eventArgs.CurrentDirection, _eventArgs.NextDirection);
 }