class MAGES::DeviceManager::InputController¶
Overview¶
MAGES InputController.Implements IInteractionActions ILocomotionActions and IGenericActions. Wraps Unity’s input actions to generic events that can be used by the rest of MAGES. More…
class InputController: public ScriptableObject, public MAGES::IInteractionActions, public MAGES::ILocomotionActions, public MAGES::IGenericInputActions { public: // properties bool GenericEvents; bool Interaction; bool XRSimulator; bool Locomotion; // methods void Startup(); void AddActionOnSelectLeft(Action action); void AddActionOnDeselectLeft(Action action); void AddActionOnActivateLeft(Action action); void AddActionOnDeactivateLeft(Action action); void AddActionOnSelectRight(Action action); void AddActionOnDeselectRight(Action action); void AddActionOnActivateRight(Action action); void AddActionOnDeactivateRight(Action action); float GetSelectionIntensityLeft(); float GetSelectionIntensityRight(); float GetActivationIntensityLeft(); float GetActivationIntensityRight(); void AddActionOnPerform(Action action); void AddActionOnUndo(Action action); void AddActionOnEnableMovement(Action action); void AddActionOnEnableOptions(Action action); void AddActionOnMove(ActionmoveAction); void AddActionOnSnapTurn(Action snapRotateAction); void AddActionOnSmoothTurn(Action smoothRotateAction); void AddActionOnChangeHeight(Action changeHeightAction); void AddActionOnUISelectLeft(Action uiSelectLeft); void AddActionOnUISelectCancelLeft(Action uiDeselectLeft); void AddActionOnUISelectRight(Action uiSelectLeft); void AddActionOnUISelectCancelRight(Action uiDeselectRight); void AddActionOnToggleRaycastActivation(Action action); void CustomMoveCamera(Vector2 moveInput); void CustomRotateCamera(Vector2 rotateInput); };
Inherited Members¶
public: // methods void AddActionOnSelectLeft(Action select); void AddActionOnDeselectLeft(Action deselect); void AddActionOnActivateLeft(Action activate); void AddActionOnDeactivateLeft(Action deactivate); void AddActionOnUISelectLeft(Action uiSelectLeft); void AddActionOnUISelectCancelLeft(Action uiDeselectLeft); void AddActionOnSelectRight(Action select); void AddActionOnDeselectRight(Action deselect); void AddActionOnActivateRight(Action activate); void AddActionOnDeactivateRight(Action deactivate); void AddActionOnUISelectRight(Action uiSelectLeft); void AddActionOnUISelectCancelRight(Action uiDeselectLeft); float GetSelectionIntensityLeft(); float GetSelectionIntensityRight(); float GetActivationIntensityLeft(); float GetActivationIntensityRight(); void Startup(); void AddActionOnMove(ActionmoveAction); void AddActionOnSnapTurn(Action snapRotate); void AddActionOnChangeHeight(Action changeHeight); void AddActionOnSmoothTurn(Action smoothRotate); void AddActionOnPerform(Action action); void AddActionOnUndo(Action action); void AddActionOnEnableMovement(Action action); void AddActionOnEnableOptions(Action action); void AddActionOnToggleRaycastActivation(Action action);
Detailed Documentation¶
MAGES InputController.Implements IInteractionActions ILocomotionActions and IGenericActions. Wraps Unity’s input actions to generic events that can be used by the rest of MAGES.
Properties¶
bool GenericEvents
Gets or sets a value indicating whether the generic input actions of MAGES are enabled.
bool Interaction
Gets or sets a value indicating whether the actions for interaction are enabled.
bool XRSimulator
Gets or sets a value indicating whether the actions for desktop mode are enabled.
bool Locomotion
Gets or sets a value indicating whether the actions for locomotion are enabled.
Methods¶
void Startup()
Initialize all input actions.
Enables the actions of the Unity Input System.
void AddActionOnSelectLeft(Action action)
Adds an action to be called when one of the select buttons are pressed on the left controller.
Uses Unity Input System.
Parameters:
select |
The event that will be called on select. |
void AddActionOnDeselectLeft(Action action)
Adds an action to be called when one of the select buttons are released.
Uses Unity Input System.
Parameters:
deselect |
The event that will be called on deSelect. |
void AddActionOnActivateLeft(Action action)
Adds an action to be called when one of the activation buttons are pressed.
Uses Unity Input System.
Parameters:
activate |
The event that will be called on activation. |
void AddActionOnDeactivateLeft(Action action)
Adds an action to be called when one of the activation buttons are released.
Uses Unity Input System.
Parameters:
deactivate |
The event that will be called on deActivation. |
void AddActionOnSelectRight(Action action)
Adds an action to be called when one of the select buttons are pressed on the right controller.
Uses Unity Input System.
Parameters:
select |
The event that will be called on select. |
void AddActionOnDeselectRight(Action action)
Adds an action to be called when one of the select buttons are released on the right controller.
Uses Unity Input System.
Parameters:
deselect |
The event that will be called on deSelect. |
void AddActionOnActivateRight(Action action)
Adds an action to be called when one of the activation buttons are pressed on the right controller.
Uses Unity Input System.
Parameters:
activate |
The event that will be called on activation. |
void AddActionOnDeactivateRight(Action action)
Adds an action to be called when one of the activation buttons are released on the right controller.
Uses Unity Input System.
Parameters:
deactivate |
The event that will be called on deActivation. |
float GetSelectionIntensityLeft()
Gets the grip value of the left controller.
Uses Unity Input System.
Returns:
The current grip value of the left controller.
float GetSelectionIntensityRight()
Gets the grip value of the right controller.
Uses Unity Input System.
Returns:
The current grip value of the right controller.
float GetActivationIntensityLeft()
Gets the trigger value of the left controller.
Uses Unity Input System.
Returns:
The current trigger value of the left controller.
float GetActivationIntensityRight()
Gets the trigger value of the right controller.
Uses Unity Input System.
Returns:
The current trigger value of the right controller.
void AddActionOnPerform(Action action)
Adds an action to be called when one of the perform buttons are pressed.
Uses Unity Input System.
Parameters:
action |
The action that will be called. |
void AddActionOnUndo(Action action)
Adds an action to be called when one of the undo buttons are pressed.
Uses Unity Input System.
Parameters:
action |
The action that will be called. |
void AddActionOnEnableMovement(Action action)
Adds an action to be called when the enable movement button is pressed.
Uses Unity Input System.
Parameters:
action |
The action that will be called. |
void AddActionOnEnableOptions(Action action)
Adds an action to be called when the enable options button is pressed.
Uses Unity Input System.
Parameters:
action |
The action that will be called. |
void AddActionOnMove(ActionmoveAction)
Adds an action to be called when a move button is held.
Uses Unity Input System.
Parameters:
moveAction |
The action that will be called with argument the 2D direction. |
void AddActionOnSnapTurn(ActionsnapRotateAction)
Adds an action to be called when the camera turn button is pressed.
Uses Unity Input System.
Parameters:
snapRotate |
The action that will be called with argument the direction. |
void AddActionOnSmoothTurn(ActionsmoothRotateAction)
Adds an action to be called when a rotate button is held.
Uses Unity Input System.
Parameters:
smoothRotate |
The action that will be called with argument the 2D direction. |
void AddActionOnChangeHeight(ActionchangeHeightAction)
Adds an action to be called when a change height button is pressed.
Uses Unity Input System.
Parameters:
changeHeight |
The action that will be called with argument the direction. |
void AddActionOnUISelectLeft(Action uiSelectLeft)
Adds an action to be called when the UI select button is pressed on the left controller.
Parameters:
uiSelectLeft |
The event that will be called. |
void AddActionOnUISelectCancelLeft(Action uiDeselectLeft)
Adds an action to be called when the UI select button is released on the left controller.
Parameters:
uiDeselectLeft |
The event that will be called. |
void AddActionOnUISelectRight(Action uiSelectLeft)
Adds an action to be called when the UI select button is pressed on the right controller.
Parameters:
uiSelectLeft |
The event that will be called. |
void AddActionOnUISelectCancelRight(Action uiDeselectRight)
Adds an action to be called when the UI select button is released on the right controller.
Parameters:
uiDeselectLeft |
The event that will be called. |
void AddActionOnToggleRaycastActivation(Action action)
Adds an action to be called when the toggle raycast button is pressed.
Parameters:
action |
The action that will be called. |
void CustomMoveCamera(Vector2 moveInput)
Moves the camera directly from the passed input. Does not use unity’s bindings.
Parameters:
moveInput |
The 2D vector that defines how the camera should be moved. |
void CustomRotateCamera(Vector2 rotateInput)
Rotates the camera directly from the passed input. Does not use unity’s bindings.
Parameters:
rotateInput |
The 2D vector that defines how the camera will rotate. |