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 MAGES::IMobile3DActions { public: // properties bool GenericEvents; bool Interaction; bool XRSimulator; bool Locomotion; bool Mobile3D; // methods void Startup(); void Shutdown(); 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 AddActionOnSmoothTurn(Action smoothTurn); 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 CustomChangeCameraHeight(float moveInput); void CustomRotateCamera(Vector2 rotateInput); void AddActionOnPointerPosition(Action mouseMoveAction); void AddActionOnPointer(Action mousePressAction); void AddActionOnMouseHold(Action mousePressAction); };
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 AddActionOnMove(ActionmoveAction); void AddActionOnSnapTurn(Action snapRotate); void AddActionOnChangeHeight(Action changeHeight); void AddActionOnSmoothTurn(Action smoothRotate); void AddActionOnSmoothTurn(Action smoothRotate); void AddActionOnPerform(Action action); void AddActionOnUndo(Action action); void AddActionOnEnableMovement(Action action); void AddActionOnEnableOptions(Action action); void AddActionOnToggleRaycastActivation(Action action); void AddActionOnPointerPosition(Action pointerMoveAction); void AddActionOnPointer(Action pointerPressAction); void AddActionOnMouseHold(Action pointerPressAction);
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.
bool Mobile3D
Gets or sets a value indicating whether the actions for mobile3d are enabled.
Methods¶
void Startup()
Enables the actions of the Unity Input System.
void Shutdown()
Disables all the actions.
void AddActionOnSelectLeft(Action action)
Adds an action to be called when one of the select buttons are pressed on the left controller.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
Uses Unity Input System.
Parameters:
deactivate |
The event that will be called on deActivation. |
float GetSelectionIntensityLeft()
Gets the grip value of the left controller.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
Uses Unity Input System.
Returns:
The current grip value of the left controller.
float GetSelectionIntensityRight()
Gets the grip value of the right controller.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
Uses Unity Input System.
Returns:
The current grip value of the right controller.
float GetActivationIntensityLeft()
Gets the trigger value of the left controller.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
Uses Unity Input System.
Returns:
The current trigger value of the left controller.
float GetActivationIntensityRight()
Gets the trigger value of the right controller.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
Uses Unity Input System.
Parameters:
smoothRotate |
The action that will be called with argument the 2D direction. |
void AddActionOnSmoothTurn(ActionsmoothTurn)
Adds an action to be called when the rotate axis is held.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
Uses Unity Input System.
Parameters:
smoothRotate |
The action that will be called with argument a 1D Axis. |
void AddActionOnChangeHeight(ActionchangeHeightAction)
Adds an action to be called when a change height button is pressed.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
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.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
Parameters:
action |
The action that will be called. |
void CustomMoveCamera(Vector2 moveInput)
Moves the camera horizontaly 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 CustomChangeCameraHeight(float moveInput)
Moves the camera vertically directly from the passed input. Does not use unity’s bindings.
Parameters:
moveInput |
The float value 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. |
void AddActionOnPointerPosition(ActionmouseMoveAction)
Mobile 3D pointer position movement.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
Parameters:
pointerMoveAction |
The action that will be called. |
void AddActionOnPointer(ActionmousePressAction)
Mobile 3D pointer press.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
Parameters:
pointerPressAction |
The action that will be called. |
void AddActionOnMouseHold(ActionmousePressAction)
Mobile 3D pointer press.
Deprecated This function is deprecated and will be removed in future versions. Please use DeviceManager ‘s OnDriverEvent to listen for events.
Parameters:
pointerPressAction |
The action that will be called. |