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

NameDescription
Public methodUxrLaserPointer

Properties

NameDescription
Public propertyBlockingMask Gets or sets the which layers will block the laser for 3D objects.
Public propertyClickInput Gets or sets the input button(s) required for a click.
Public propertyCurrentRayLength Gets the current laser ray length.
Public propertyForceLaserEnabled 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.
Public propertyHandSide Gets the hand the laser pointer belongs to.
Public propertyIgnoreAutoEnable Gets or sets whether the laser should ignore the AutoEnableLaserPointer property in canvases.
Public propertyIsInvisible Gets or sets whether to use an invisible laser ray.
Public propertyIsLaserEnabled Gets whether the laser is currently enabled.
Public propertyLaserDir Gets the laser direction.
Public propertyLaserPos Gets the laser origin position.
Public propertyLaserTransform Gets the Transform that is used to compute the direction in which the laser points. The laser will point in the forward direction.
Public propertyMaxRayLength Gets or sets the maximum laser length. This is the distance that the ray will travel if not occluded.
Public propertyOptionalEnableWhenLaserOn Gets or sets an optional GameObject that will be enabled or disabled along with the laser.
Public propertyRayColorInteractive Gets or sets the ray color when it’s pointing to an interactive element.
Public propertyRayColorNonInteractive Gets or sets the ray color when it’s not pointing to an interactive element.
Public propertyRayHitSize Gets or sets the size of the ray hit quad..
Public propertyRayWidth Gets or sets the laser ray width.
Public propertyShowLaserButtonEvent Gets or sets the button event type required for ShowLaserInput.
Public propertyShowLaserInput 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.
Public propertyTargetTypes Gets or sets the elements the laser can interact with.
Public propertyTriggerCollidersInteraction Gets or sets how to treat collisions against trigger volumes. By default the laser doesn’t collide against trigger volumes.
Public propertyUseControllerForward Gets or sets whether to use the real controller forward instead of the component’s forward.

Methods

NameDescription
Protected methodAwake Initializes the component. (Overrides UxrAvatarComponent<T>.Awake().)
Public methodIsClickedThisFrame Checks whether the user performed a click this frame (released the input button after pressing).
Public methodIsReleasedThisFrame Checks whether the user performed a press this frame (pressed the input button).

Fields

NameDescription
Protected field_clickInput
Protected field_handSide
Protected field_invisible
Protected field_optionalEnableWhenLaserOn
Protected field_rayColorInteractive
Protected field_rayColorNonInteractive
Protected field_rayHitMaterial
Protected field_rayHitSize
Protected field_rayLength
Protected field_rayWidth
Protected field_showLaserButtonEvent
Protected field_showLaserInput
Protected field_targetTypes
Protected field_useControllerForward

Extension Methods

NameDescription
Public Extension MethodCheckSetEnabled Enables/disabled the component if it isn’t enabled already. (Defined by MonoBehaviourExt.)
Public Extension MethodGetOrAddComponent<T> Gets the Component of a given type. If it doesn’t exist, it is added to the GameObject. (Defined by ComponentExt.)
Public Extension MethodGetPathUnderScene Gets the full path under current scene, including all parents, but scene name, for the given component. (Defined by ComponentExt.)
Public Extension MethodGetSceneUid Gets an unique identifier string for the given component. (Defined by ComponentExt.)
Public Extension MethodGetUniqueScenePath 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.)
Public Extension MethodLoopCoroutine Creates a coroutine that simplifies executing a loop during a certain amount of time. (Defined by MonoBehaviourExt.)
Public Extension MethodSafeGetComponentInParent<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.)
Public Extension MethodShowInInspector(Boolean)Overloaded.
Controls whether to show the current object in the inspector. (Defined by ObjectExt.)
Public Extension MethodShowInInspector(Boolean, Boolean)Overloaded.
Controls whether to show the current object in the inspector and whether it is editable. (Defined by ObjectExt.)
Public Extension MethodThrowIfNull Throws an exception if the object is null. (Defined by ObjectExt.)

See Also

Reference

UltimateXR.UI Namespace