private void HandleTriggerCommand(GamepadCommand command, string trigger, float value) { if ((trigger.Contains("Right") && 0f < value) || (trigger.Contains("Left") && value < 0f)) { switch (command) { case GamepadCommand.Move: if (!hasMoved) { controlledPlayer.MoveX(value); } break; case GamepadCommand.Jump: controlledPlayer.Jump(); break; case GamepadCommand.Transpose: if (!hasTransposed) { controlledPlayer.Transpose(); hasTransposed = true; } break; case GamepadCommand.Interact: if (!hasInteracted) { controlledPlayer.Interact(); } break; } } }
// One of the gamepad button input was pressed private void HandleButtonDownCommand(GamepadCommand command) { switch (command) { case GamepadCommand.Move: break; case GamepadCommand.Jump: controlledPlayer.Jump(); break; case GamepadCommand.Transpose: if (!hasTransposed) { controlledPlayer.Transpose(); hasTransposed = true; } break; case GamepadCommand.Interact: if (!hasInteracted) { controlledPlayer.Interact(); } break; case GamepadCommand.ResetShadow: controlledPlayer.ResetShadow(); break; } }
// One of the gamepad button input is being pressed private void HandleButtonPressedCommand(GamepadCommand command) { switch (command) { case GamepadCommand.Move: if (!hasMoved) { controlledPlayer.MoveX(1f); } break; case GamepadCommand.Jump: break; case GamepadCommand.Transpose: break; case GamepadCommand.Interact: break; } }
// Check Axis values private void HandleAxisCommand(GamepadCommand command, float value) { switch (command) { case GamepadCommand.Move: if (!hasMoved) { controlledPlayer.MoveX(value); } break; case GamepadCommand.Jump: controlledPlayer.Jump(); break; case GamepadCommand.Transpose: break; case GamepadCommand.Interact: break; } }
// One of the gamepad button input was released private void HandleButtonUpCommand(GamepadCommand command) { switch (command) { case GamepadCommand.Move: if (!hasMoved) { controlledPlayer.MoveX(0f); } break; case GamepadCommand.Jump: //controlledPlayer.Jump(false); break; case GamepadCommand.Transpose: break; case GamepadCommand.Interact: break; } }