private void StartForcedMovement(bool isStartingLastWord) { for (int playerNum = 0; playerNum < players.Length; ++playerNum) { int playerNumCopy = playerNum; ForceMoveTransitionInfo transitionInfo = new ForceMoveTransitionInfo { onCompleteMove = (ForceMoveTransitionInfo.AllInPositionAction onAllInPosition) => OnCompleteMove(playerNumCopy, isStartingLastWord, onAllInPosition), isLastWordCaster = isStartingLastWord && playerNum == lastWordPlayerNumber, moveTime = lastWordMoveTime, }; SharedCharacterController cc = players[playerNum].GetComponent <SharedCharacterController>(); if (isStartingLastWord) { transitionInfo.moveDestination = lastWordPositions[playerNum].position; } else if (cc.HasCircle()) { transitionInfo.moveDestination = cc.GetCirclePosition(); } else { transitionInfo.moveDestination = spawnPoints[playerNum].position; } switch (CharacterSelection.Instance.GetPlayerCharacterType(playerNum)) { case CharacterType.SELENE: Selene selene = players[playerNum].GetComponent <Selene>(); selene.ChangeStateSoft <SeleneForceMoveState>(transitionInfo); break; case CharacterType.RHEA: Rhea rhea = players[playerNum].GetComponent <Rhea>(); rhea.ChangeStateSoft <RheaForceMoveState>(transitionInfo); break; } } }
override public void Enter(SeleneStateInput input, CharacterStateTransitionInfo transitionInfo = null) { this.transitionInfo = (ForceMoveTransitionInfo)transitionInfo; travelOrigin = character.transform.position; travelTimer = this.transitionInfo.moveTime; }