Haply::Inverse::Unity::CursorBehaviour
Inherits from MonoBehaviour
Inherited by Haply.Inverse.Unity.Inverse3Cursor, Haply.Inverse.Unity.VerseGripCursor
Protected Functions
Name | |
---|---|
virtual GameObject | GetModelPrefab() Gets the prefab that should be instantiated upon startup. |
virtual void | UpdateCursor() Updates the cursor every frame. |
virtual void | Awake() See MonoBehaviour. |
void | FixedUpdate() See MonoBehaviour. |
Public Properties
Name | |
---|---|
DeviceBehaviour | Device Device that controls the cursor. |
bool | IsDeviceSet Indicates whether the Device has been set. |
Transform | ModelPrefab The prefab of a cursor model to show for this cursor that this behaviour automatically instantiates. |
Transform | ModelParent The transform that this behaviour uses as the parent for the model prefab when it is instantiated. |
Transform | Model The instance of the cursor model in the scene. |
bool | HideControllerModel Whether to hide the cursor model. |
float | Radius 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.