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); } } }
private void OnStartDirectionChange(OnStartDirectionChangeArgs _args) { StartDirectional(_args.NextDirection); }
private void OnStartDirectionChange(OnStartDirectionChangeArgs _eventArgs) { CheckDirectional(_eventArgs.CurrentDirection, _eventArgs.NextDirection); }