UxrLaserPointer Class
Component that, added to an object in an UxrAvatar , allows it to interact with user interfaces using a laser pointer. It is normally added to the hand, so that it points in a forward direction from the hand, but can also be added to inanimate objects.
Inheritance Hierarchy
System.Object
Object
Component
Behaviour
MonoBehaviour
UltimateXR.Core.Components.UxrComponent
UltimateXR.Core.Components.UxrComponent(UxrLaserPointer)
UltimateXR.Core.Components.Composite.UxrAvatarComponent(UxrLaserPointer)
UltimateXR.UI.UxrLaserPointer
UltimateXR.UI.UxrCameraPointer
Namespace: UltimateXR.UI
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public class UxrLaserPointer : UxrAvatarComponent<UxrLaserPointer>
The UxrLaserPointer type exposes the following members.
Constructors
Name | Description | |
---|---|---|
UxrLaserPointer |
Properties
Name | Description | |
---|---|---|
BlockingMask | Gets or sets the which layers will block the laser for 3D objects. | |
ClickInput | Gets or sets the input button(s) required for a click. | |
CurrentRayLength | Gets the current laser ray length. | |
ForceLaserEnabled | Gets or sets whether the laser should be forcefully enabled. This is useful when AutoEnableLaserPointer is used or a controller input is required to enable the laser pointer. | |
HandSide | Gets the hand the laser pointer belongs to. | |
IgnoreAutoEnable | Gets or sets whether the laser should ignore the AutoEnableLaserPointer property in canvases. | |
IsInvisible | Gets or sets whether to use an invisible laser ray. | |
IsLaserEnabled | Gets whether the laser is currently enabled. | |
LaserDir | Gets the laser direction. | |
LaserPos | Gets the laser origin position. | |
LaserTransform | Gets the Transform that is used to compute the direction in which the laser points. The laser will point in the forward direction. | |
MaxRayLength | Gets or sets the maximum laser length. This is the distance that the ray will travel if not occluded. | |
OptionalEnableWhenLaserOn | Gets or sets an optional GameObject that will be enabled or disabled along with the laser. | |
RayColorInteractive | Gets or sets the ray color when it’s pointing to an interactive element. | |
RayColorNonInteractive | Gets or sets the ray color when it’s not pointing to an interactive element. | |
RayHitSize | Gets or sets the size of the ray hit quad.. | |
RayWidth | Gets or sets the laser ray width. | |
ShowLaserButtonEvent | Gets or sets the button event type required for ShowLaserInput. | |
ShowLaserInput | Gets or sets the input button(s) required to show the laser. Use None to have the laser always enabled or Everything to have it always disabled and let AutoEnableLaserPointer handle the enabling/disabling. | |
TargetTypes | Gets or sets the elements the laser can interact with. | |
TriggerCollidersInteraction | Gets or sets how to treat collisions against trigger volumes. By default the laser doesn’t collide against trigger volumes. | |
UseControllerForward | Gets or sets whether to use the real controller forward instead of the component’s forward. |
Methods
Name | Description | |
---|---|---|
Awake | Initializes the component. (Overrides UxrAvatarComponent<T>.Awake().) | |
IsClickedThisFrame | Checks whether the user performed a click this frame (released the input button after pressing). | |
IsReleasedThisFrame | Checks whether the user performed a press this frame (pressed the input button). |
Fields
Extension Methods
Name | Description | |
---|---|---|
CheckSetEnabled | Enables/disabled the component if it isn’t enabled already. (Defined by MonoBehaviourExt.) | |
GetOrAddComponent<T> | Gets the Component of a given type. If it doesn’t exist, it is added to the GameObject. (Defined by ComponentExt.) | |
GetPathUnderScene | Gets the full path under current scene, including all parents, but scene name, for the given component. (Defined by ComponentExt.) | |
GetSceneUid | Gets an unique identifier string for the given component. (Defined by ComponentExt.) | |
GetUniqueScenePath | Gets an unique path in the scene for the given component. It will include scene name, sibling and component indices to make it unique. (Defined by ComponentExt.) | |
LoopCoroutine | Creates a coroutine that simplifies executing a loop during a certain amount of time. (Defined by MonoBehaviourExt.) | |
SafeGetComponentInParent<T> | Gets the Component of a given type in the GameObject or any of its parents. It also works on prefabs, where regular GetComponentInParent(Type, Boolean) will not work: https://issuetracker.unity3d.com/issues/getcomponentinparent-is-returning-null-when-the-gameobject-is-a-prefab (Defined by ComponentExt.) | |
ShowInInspector(Boolean) | Overloaded. Controls whether to show the current object in the inspector. (Defined by ObjectExt.) | |
ShowInInspector(Boolean, Boolean) | Overloaded. Controls whether to show the current object in the inspector and whether it is editable. (Defined by ObjectExt.) | |
ThrowIfNull | Throws an exception if the object is null. (Defined by ObjectExt.) |