Class BaseCursor
Object that represents a cursor in 3D space.
Implements
IEventSystemHandler
Assembly: cs.temp.dll.dll
public class BaseCursor : MonoBehaviour, IMixedRealityCursor, IMixedRealityFocusChangedHandler, IMixedRealitySourceStateHandler, IMixedRealityPointerHandler, IEventSystemHandler
Fields
Declaration
protected Transform PrimaryCursorVisual
Field Value
Type |
Description |
Transform |
|
Declaration
public List<uint> SourceDownIds
Field Value
Declaration
protected GameObject TargetedObject
Field Value
Type |
Description |
GameObject |
|
Declaration
protected Vector3 targetPosition
Field Value
Declaration
protected Quaternion targetRotation
Field Value
Type |
Description |
Quaternion |
|
Declaration
protected Vector3 targetScale
Field Value
Properties
The angular scale of cursor in relation to Main Camera, assuming a mesh with bounds of Vector3(1,1,1)
Declaration
public float CursorAngularScale { get; set; }
Property Value
The angular size of cursor in relation to Main Camera, assuming a mesh with bounds of Vector3(1,1,1)
Declaration
public float CursorAngularSize { get; set; }
Property Value
CursorContext
Declaration
public CursorContextEnum CursorContext { get; }
Property Value
Declaration
public CursorStateEnum CursorState { get; }
Property Value
The maximum distance the cursor can be with nothing hit
Declaration
public float DefaultCursorDistance { get; set; }
Property Value
Declaration
public GameObject GameObjectReference { get; }
Property Value
Declaration
public bool IsPointerDown { get; }
Property Value
Checks whether the associated pointer is null, and if the pointer is a UnityEngine.Object it also checks whether it has been destroyed.
Declaration
protected bool IsPointerValid { get; }
Property Value
Declaration
protected bool IsSourceDetected { get; }
Property Value
Is the cursor currently visible?
Declaration
public bool IsVisible { get; }
Property Value
Declaration
public virtual Vector3 LocalScale { get; }
Property Value
Blend value for surface normal to user facing lerp.
Declaration
public float LookRotationBlend { get; set; }
Property Value
Declaration
public virtual IMixedRealityPointer Pointer { get; set; }
Property Value
Declaration
public virtual Vector3 Position { get; }
Property Value
Blend value for surface normal to user facing lerp.
Declaration
public float PositionLerpTime { get; set; }
Property Value
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.
Declaration
public bool ResizeCursorWithDistance { get; set; }
Property Value
Declaration
public virtual Quaternion Rotation { get; }
Property Value
Type |
Description |
Quaternion |
|
Blend value for surface normal to user facing lerp.
Declaration
public float RotationLerpTime { get; set; }
Property Value
Blend value for surface normal to user facing lerp.
Declaration
public float ScaleLerpTime { get; set; }
Property Value
Declaration
public bool SetVisibilityOnSourceDetected { get; set; }
Property Value
Declaration
public float SurfaceCursorDistance { get; }
Property Value
When lerping, use unscaled time. This is useful for games that have a pause mechanism or otherwise adjust the game timescale.
Declaration
public bool UseUnscaledTime { get; set; }
Property Value
Declaration
public uint VisibleSourcesCount { get; set; }
Property Value
Methods
CheckCursorContext()
Virtual function for checking cursor context changes.
Declaration
public virtual CursorContextEnum CheckCursorContext()
Returns
Virtual function for checking state changes.
Declaration
public virtual CursorStateEnum CheckCursorState()
Returns
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.
Declaration
public virtual void Destroy()
Declaration
protected void LerpToTargetTransform()
Focus event that is raised before the focus is actually changed.
Declaration
public virtual void OnBeforeFocusChange(FocusEventData eventData)
Parameters
OnCursorContextChange(CursorContextEnum)
Change the cursor context state to the new context. Override in cursor implementations.
Declaration
public virtual void OnCursorContextChange(CursorContextEnum context)
Parameters
Change the cursor state to the new state. Override in cursor implementations.
Declaration
public virtual void OnCursorStateChange(CursorStateEnum state)
Parameters
Declaration
protected virtual void OnDisable()
Declaration
protected virtual void OnEnable()
Focus event that is raised when the focused object is changed.
Declaration
public virtual void OnFocusChanged(FocusEventData eventData)
Parameters
Disable input and set to contextual to override input
Declaration
public virtual void OnInputDisabled()
Enable input and set to none to reset cursor
Declaration
public virtual void OnInputEnabled()
When a pointer clicked event is raised, this method is used to pass along the event data to the input handler.
Declaration
public virtual void OnPointerClicked(MixedRealityPointerEventData eventData)
Parameters
When a pointer down event is raised, this method is used to pass along the event data to the input handler.
Declaration
public virtual void OnPointerDown(MixedRealityPointerEventData eventData)
Parameters
Called every frame a pointer is down. Can be used to implement drag-like behaviors.
Declaration
public virtual void OnPointerDragged(MixedRealityPointerEventData eventData)
Parameters
When a pointer up event is raised, this method is used to pass along the event data to the input handler.
Declaration
public virtual void OnPointerUp(MixedRealityPointerEventData eventData)
Parameters
Raised when a source is detected.
Declaration
public virtual void OnSourceDetected(SourceStateEventData eventData)
Parameters
Raised when a source is lost.
Declaration
public virtual void OnSourceLost(SourceStateEventData eventData)
Parameters
Register to events from the managers the cursor needs.
Declaration
protected virtual void RegisterManagers()
Declaration
public virtual void SetVisibility(bool visible)
Parameters
Type |
Name |
Description |
Boolean |
visible |
|
Declaration
protected void SnapToTargetTransform()
Declaration
protected virtual void Start()
Unregister from events from the managers the cursor needs.
Declaration
protected virtual void UnregisterManagers()
Update the cursor's transform
Declaration
protected virtual void UpdateCursorTransform()
Implements
IEventSystemHandler