Skip to main content
Version: 2.0.0

Haply::Inverse::Unity::CursorBehaviour

Inherits from MonoBehaviour

Inherited by Haply.Inverse.Unity.Inverse3Cursor, Haply.Inverse.Unity.VerseGripCursor

Protected Functions​

Name
virtual GameObjectGetModelPrefab()
Gets the prefab that should be instantiated upon startup.
virtual voidUpdateCursor()
Updates the cursor every frame.
virtual voidAwake()
See MonoBehaviour.
voidFixedUpdate()
See MonoBehaviour.

Public Properties​

Name
DeviceBehaviourDevice
Device that controls the cursor.
boolIsDeviceSet
Indicates whether the Device has been set.
TransformModelPrefab
The prefab of a cursor model to show for this cursor that this behaviour automatically instantiates.
TransformModelParent
The transform that this behaviour uses as the parent for the model prefab when it is instantiated.
TransformModel
The instance of the cursor model in the scene.
boolHideControllerModel
Whether to hide the cursor model.
floatRadius
Gets the Model radius.

Protected Functions Documentation​

function GetModelPrefab​

virtual GameObject GetModelPrefab()

Gets the prefab that should be instantiated upon startup.

Return: Returns the prefab that should be instantiated upon startup.

function UpdateCursor​

virtual void UpdateCursor()

Updates the cursor every frame.

Reimplemented by: Haply::Inverse::Unity::Inverse3Cursor::UpdateCursor, Haply::Inverse::Unity::VerseGripCursor::UpdateCursor

This is called automatically from FixedUpdate.

function Awake​

virtual void Awake()

See MonoBehaviour.

function FixedUpdate​

void FixedUpdate()

See MonoBehaviour.

Public Property Documentation​

property Device​

DeviceBehaviour Device;

Device that controls the cursor.

Return: Device controlling the cursor.

Set automatically by the device owning the cursor at runtime. Also updates IsDeviceSet flag.

property IsDeviceSet​

bool IsDeviceSet;

Indicates whether the Device has been set.

This property helps in optimizing checks for the Device's existence, as direct comparisons with null can be expensive in Unity.

property ModelPrefab​

Transform ModelPrefab;

The prefab of a cursor model to show for this cursor that this behaviour automatically instantiates.

See: Model

This behaviour automatically instantiates an instance of the prefab as a child of ModelParent upon startup unless Model is already set, in which case this value is ignored.

property ModelParent​

Transform ModelParent;

The transform that this behaviour uses as the parent for the model prefab when it is instantiated.

Automatically instantiated and set in Awake if not already set. Setting this will not automatically destroy the previous object.

property Model​

Transform Model;

The instance of the cursor model in the scene.

You can set this to an existing object instead of using ModelPrefab.

If set, it should reference a child GameObject of this behaviour so it will update with the cursor pose.

property HideControllerModel​

bool HideControllerModel;

Whether to hide the cursor model.

See: Model

property Radius​

float Radius;

Gets the Model radius.

Zero if the cursor is not a PrimitiveType.Sphere.

This value is automatically updated by SetupModel when _performSetup flag is fired.