void CheckCharacterMovementInput() { CharacterAction nextAction = CharacterAction.NoAction; bool interacting = false; if (stunned) { nextAction = CharacterAction.Wait; } else if (confused) { nextAction = m_Input.GetRandomAction(); } else { nextAction = m_Input.CheckMovementInput(); interacting = m_Input.CheckInteractionInput(); } switch (nextAction) { case CharacterAction.MoveForward: m_MovementController.Move(transform.forward); break; case CharacterAction.Backstep: m_MovementController.Move(transform.forward * -1); break; case CharacterAction.MoveLeft: m_MovementController.Move(transform.right * -1); break; case CharacterAction.MoveRight: m_MovementController.Move(transform.right); break; case CharacterAction.TurnLeft: m_MovementController.Turn(-1); break; case CharacterAction.TurnRight: m_MovementController.Turn(1); break; case CharacterAction.Wait: SwitchCharacterStatus(CharacterStatus.idle); ActivationIsDone(); break; } if (interacting) { TileBase tile = m_MovementController.CheckTile(transform.forward); InteractableBase interactable = tile.GetComponentInChildren <InteractableBase>(); if (interactable != null) { interactable.InteractedWith(); SwitchCharacterStatus(CharacterStatus.idle); if (DungeonBaseController.instance.currentDungeonTurnState != DungeonBaseController.dungeonTurnState.SettingUpDungeon) { ActivationIsDone(); } } } if (nextAction != CharacterAction.NoAction) { LastAction = nextAction; } }