class MAGES::DeviceManager::MAGESDeviceManagerV2¶
Overview¶
class MAGESDeviceManagerV2: public MAGES::DeviceManagerModule, public MAGES::ILocomotionActions, public MAGES::IGenericInputActions, public MAGES::IInteractionActions, public MAGES::IMobile3DActions { public: // properties override CameraMode CurrentMode; override IDriver ActiveDriver; override int Version; override IDriver DriverOverride; List<IDriver> Drivers; // methods override void Startup(); override void Shutdown(); virtual override void UpdateModule(UpdatePhase updatePhase); void AddActionOnMove(ActionmoveAction); void AddActionOnSnapTurn(Action snapRotate); void AddActionOnChangeHeight(Action changeHeight); void AddActionOnSmoothTurn(Action smoothRotate); void AddActionOnSmoothTurn(Action smoothTurn); void AddActionOnPerform(Action action); void AddActionOnUndo(Action action); void AddActionOnEnableMovement(Action action); void AddActionOnEnableOptions(Action action); void AddActionOnToggleRaycastActivation(Action action); 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 AddActionOnPointerPosition(Action pointerMoveAction); void AddActionOnPointer(Action pointerPressAction); void AddActionOnMouseHold(Action pointerHoldAction); void UpdateAvailableDrivers(); virtual override bool TrySendHapticImpulse( Device device, float intensity = 0.8F, float duration = 0.1F ); virtual override bool IsDeviceAvailable(Device device); };
Inherited Members¶
public: // enums enum CameraMode; enum Device; // properties int Version; IDriver ActiveDriver; IDriver DriverOverride; UnityEvent<DriverChangeEventArgs> OnDriverChanged; UnityEvent<DriverEvent> OnDriverEvent; CameraMode CurrentMode; float CameraHeight; GameObject MobileNavigationUI; IInteractionActions InteractionActions; ILocomotionActions LocomotionActions; IGenericInputActions GenericActions; IMobile3DActions Mobile3DActions; GameObject CameraGameObject; GameObject CameraRig; GameObject LeftController; Transform LeftControllerOffset; GameObject RightController; Transform RightControllerOffset; Camera CameraRef; GameObject RigPrefab; // methods void Startup(); void Shutdown(); virtual void UpdateModule(UpdatePhase updatePhase); virtual bool TrySendHapticImpulse( Device device, float intensity = 0.8f, float duration = 0.1f ); virtual bool IsDeviceAvailable(Device device); virtual bool SendHapticPulse( string controllerSide, float intensity, float duration = 0.1f ); virtual bool IsXRControllerAvailable(string controllerName); 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 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 AddActionOnPointerPosition(Action pointerMoveAction); void AddActionOnPointer(Action pointerPressAction); void AddActionOnMouseHold(Action pointerPressAction);
Detailed Documentation¶
MAGES device manager.
See also:
IDriver
Properties¶
override CameraMode CurrentMode
Deprecated This is obsolete and will always be set to CameraMode.None. Instead listen to DeviceManagerModule.OnDriverEvent instead.
override IDriver ActiveDriver
Gets the currently active driver.
List<IDriver> Drivers
Gets a sorted by priority list of all the drivers.
Methods¶
virtual override void UpdateModule(UpdatePhase updatePhase)
Called while the module is active.
Parameters:
updatePhase |
The phase of the update. |
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.
Parameters:
moveAction |
The action that will be called with argument the 2D direction. |
void AddActionOnSnapTurn(ActionsnapRotate)
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.
Parameters:
snapRotate |
The action that will be called with argument the direction. |
void AddActionOnChangeHeight(ActionchangeHeight)
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.
Parameters:
changeHeight |
The action that will be called with argument the direction. |
void AddActionOnSmoothTurn(ActionsmoothRotate)
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.
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.
Parameters:
smoothRotate |
The action that will be called with argument a 1D Axis. |
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.
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.
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.
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.
Parameters:
action |
The action 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 AddActionOnSelectLeft(Action select)
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.
Parameters:
select |
The event that will be called on select. |
void AddActionOnDeselectLeft(Action deselect)
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.
Parameters:
deselect |
The event that will be called on deSelect. |
void AddActionOnActivateLeft(Action activate)
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.
Parameters:
activate |
The event that will be called on activation. |
void AddActionOnDeactivateLeft(Action deactivate)
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.
Parameters:
deactivate |
The event that will be called on deActivation. |
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 AddActionOnSelectRight(Action select)
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.
Parameters:
select |
The event that will be called on select. |
void AddActionOnDeselectRight(Action deselect)
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.
Parameters:
deselect |
The event that will be called on deSelect. |
void AddActionOnActivateRight(Action activate)
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.
Parameters:
activate |
The event that will be called on activation. |
void AddActionOnDeactivateRight(Action deactivate)
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.
Parameters:
deactivate |
The event that will be called on deActivation. |
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 uiDeselectLeft)
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. |
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.
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.
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.
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.
Returns:
The current trigger value of the right controller.
void AddActionOnPointerPosition(ActionpointerMoveAction)
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(ActionpointerPressAction)
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(ActionpointerHoldAction)
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 UpdateAvailableDrivers()
Updates the Drivers list with all available drivers.
virtual override bool TrySendHapticImpulse( Device device, float intensity = 0.8F, float duration = 0.1F )
Tries to send a haptic impulse to the left controller.
If the left controller is not available, or the driver does not support haptic impulses, this method does nothing.
virtual override bool IsDeviceAvailable(Device device)
Gets if the device is available and tracking for it is supported.
Parameters:
device |
The device. |
Returns:
true
if the device is available.