Edit

Share via


ObjectCursor Class

Definition

The object cursor can switch between different game objects based on its state. It simply links the game object to set to active with its associated cursor state.

public ref class ObjectCursor : Microsoft::MixedReality::Toolkit::Input::BaseCursor
[UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/ObjectCursor")]
public class ObjectCursor : Microsoft.MixedReality.Toolkit.Input.BaseCursor
[<UnityEngine.AddComponentMenu("Scripts/MRTK/SDK/ObjectCursor")>]
type ObjectCursor = class
    inherit BaseCursor
Public Class ObjectCursor
Inherits BaseCursor
Inheritance
UnityEngine.MonoBehaviour
ObjectCursor
Attributes
UnityEngine.AddComponentMenuAttribute

Constructors

ObjectCursor()

Fields

CursorStateData
ParentTransform

Sprite renderer to change. If null find one in children

PrimaryCursorVisual (Inherited from BaseCursor)
SourceDownIds (Inherited from BaseCursor)
TargetedObject (Inherited from BaseCursor)
targetPosition (Inherited from BaseCursor)
targetRotation (Inherited from BaseCursor)
targetScale (Inherited from BaseCursor)

Properties

CursorAngularScale
Obsolete.

The angular scale of cursor in relation to Main Camera, assuming a mesh with bounds of Vector3(1,1,1)

(Inherited from BaseCursor)
CursorAngularSize

The angular size of cursor in relation to Main Camera, assuming a mesh with bounds of Vector3(1,1,1)

(Inherited from BaseCursor)
CursorContext (Inherited from BaseCursor)
CursorState (Inherited from BaseCursor)
DefaultCursorDistance

The maximum distance the cursor can be with nothing hit

(Inherited from BaseCursor)
GameObjectReference

Returns the IMixedRealityCursor's GameObject reference.

(Inherited from BaseCursor)
IsPointerDown (Inherited from BaseCursor)
IsPointerValid

Checks whether the associated pointer is null, and if the pointer is a UnityEngine.Object it also checks whether it has been destroyed.

(Inherited from BaseCursor)
IsSourceDetected (Inherited from BaseCursor)
IsVisible

Is the cursor currently visible?

(Inherited from BaseCursor)
LocalScale

Local scale of the IMixedRealityCursor.

(Inherited from BaseCursor)
LookRotationBlend

Blend value for surface normal to user facing lerp.

(Inherited from BaseCursor)
Pointer

The IMixedRealityPointer this IMixedRealityCursor is associated with.

(Inherited from BaseCursor)
Position

Position of the IMixedRealityCursor.

(Inherited from BaseCursor)
PositionLerpTime

Blend value for surface normal to user facing lerp.

(Inherited from BaseCursor)
ResizeCursorWithDistance

Dictates whether the cursor should resize based on distance. If true, cursor will appear to be the same size no matter what distance it is from Main Camera.

(Inherited from BaseCursor)
Rotation

Rotation of the IMixedRealityCursor.

(Inherited from BaseCursor)
RotationLerpTime

Blend value for surface normal to user facing lerp.

(Inherited from BaseCursor)
ScaleLerpTime

Blend value for surface normal to user facing lerp.

(Inherited from BaseCursor)
SetVisibilityOnSourceDetected

Sets the visibility of the IMixedRealityCursor when the source is detected.

(Inherited from BaseCursor)
SurfaceCursorDistance (Inherited from BaseCursor)
UseUnscaledTime

When lerping, use unscaled time. This is useful for games that have a pause mechanism or otherwise adjust the game timescale.

(Inherited from BaseCursor)
VisibleSourcesCount (Inherited from BaseCursor)

Methods

CheckCursorContext()

Virtual function for checking cursor context changes.

(Inherited from BaseCursor)
CheckCursorState()

Virtual function for checking state changes.

(Inherited from BaseCursor)
Destroy()

Utility method to destroy cursor dependencies (e.g. event subscriptions) in the system explicitly in the middle update loop. This is a "replacement" of Unity OnDestroy. Relying on Unity OnDestroy may cause event handler subscription to become invalid at the point of destroying.

(Inherited from BaseCursor)
LerpToTargetTransform() (Inherited from BaseCursor)
OnBeforeFocusChange(FocusEventData)

Focus event that is raised before the focus is actually changed.

(Inherited from BaseCursor)
OnCursorContextChange(CursorContextEnum)

Change the cursor context state to the new context. Override in cursor implementations.

(Inherited from BaseCursor)
OnCursorStateChange(CursorStateEnum)

Override OnCursorState change to set the correct animation state for the cursor

OnDisable() (Inherited from BaseCursor)
OnEnable()

On enable look for a sprite renderer on children

OnFocusChanged(FocusEventData)

Focus event that is raised when the focused object is changed.

(Inherited from BaseCursor)
OnInputDisabled()

Disable input and set to contextual to override input

(Inherited from BaseCursor)
OnInputEnabled()

Enable input and set to none to reset cursor

(Inherited from BaseCursor)
OnPointerClicked(MixedRealityPointerEventData)

When a pointer clicked event is raised, this method is used to pass along the event data to the input handler.

(Inherited from BaseCursor)
OnPointerDown(MixedRealityPointerEventData)

When a pointer down event is raised, this method is used to pass along the event data to the input handler.

(Inherited from BaseCursor)
OnPointerDragged(MixedRealityPointerEventData)

Called every frame a pointer is down. Can be used to implement drag-like behaviors.

(Inherited from BaseCursor)
OnPointerUp(MixedRealityPointerEventData)

When a pointer up event is raised, this method is used to pass along the event data to the input handler.

(Inherited from BaseCursor)
OnSourceDetected(SourceStateEventData)

Raised when a source is detected.

(Inherited from BaseCursor)
OnSourceLost(SourceStateEventData)

Raised when a source is lost.

(Inherited from BaseCursor)
RegisterManagers()

Register to events from the managers the cursor needs.

(Inherited from BaseCursor)
SetVisibility(Boolean) (Inherited from BaseCursor)
SnapToTargetTransform() (Inherited from BaseCursor)
Start() (Inherited from BaseCursor)
UnregisterManagers()

Unregister from events from the managers the cursor needs.

(Inherited from BaseCursor)
UpdateCursorTransform()

Update the cursor's transform

(Inherited from BaseCursor)

Applies to