public override void EnterState() { movementStateMachine.ChangeState(MovementStates.Frozen); cameraStateMachine.ChangeState(CameraStates.PreIdle); respawnStartTime = Time.time; startingPosition = player.transform.position; }
void Awake() { controller = GetComponent <Controller2D>(); movementMachine = new MovementStateMachine(); movementMachine.ChangeState(new LiquidState(), this); }
public void HandleState() { switch (ActionState) { case PlayerAction.move: // jump stateMachine.ChangeState(character.MovingState); break; } }
}//Start void Update() { Vector2 directionalInput = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical")); playerMovementMachine.CurrentForm.SetDirectionalInput(directionalInput); if (Input.GetKeyDown(KeyCode.Space)) { playerMovementMachine.CurrentForm.OnJumpInputDown(); }//if if (Input.GetKeyUp(KeyCode.Space)) { playerMovementMachine.CurrentForm.OnJumpInputUp(); }//if // STATE SWITCHING <<<<< if (Input.GetKeyDown(KeyCode.G)) { Debug.Log("Entering gas state"); playerMovementMachine.ChangeState(new GasState(), player); } if (Input.GetKeyDown(KeyCode.L)) { Debug.Log("Entering liquid state"); playerMovementMachine.ChangeState(new LiquidState(), player); } if (Input.GetKeyDown(KeyCode.S)) { Debug.Log("Entering solid state"); playerMovementMachine.ChangeState(new SolidState(), player); } // STATE SWITCHING >>>>> }//Update
public override void EnterState() { teleport.BeginTeleport(targetTriggerArea.getNextTarget()); movementStateMachine.ChangeState(MovementStates.Frozen); cameraStateMachine.ChangeState(CameraStates.PreIdle); }
public override void EnterState() { movementStateMachine.ChangeState(MovementStates.InputEnabled); }