Skip to content

Highlightable Socket Interactor

eisclimber edited this page Jan 18, 2024 · 1 revision

Highlightable Socket Interactor

class in ExPresSXR.Interaction / Extends UnityEngine.XR.Interaction.Toolkit.XRSocketInteractor
GameObject instantiable via ExPresS XR/Highlightable Socket Interactor

Description

A SocketInteractor can shows a visual queue (highlighterObject) where the interactable area is of nothing is in the socket.

The visual queue can be scaled automatically if useColliderSizeAsScale is set to true and it this SocketInteractor has a SphereCollider- or BoxCollider-Component. If not the size can be set by modifying highlighterScale.

Make sure the highlighterObject does not have a Collider, only a Mesh and MeshRenderer.

Members

Public Properties

  • bool showHighlighter: If the highlighter should be shown or not.
  • GameObject highlighterObject: A Reference to the GameObject being shown as visual queue.
  • bool useColliderSizeAsScale: If true the highlighterObject will grow according to the socket interactors' collider size (only if it has a SphereCollider- or BoxCollider-Component). The scale will be a little bit smaller to prevent z-index fighting.
  • Vector3 highlighterScale: If useColliderSizeAsScale is not enabled, the scale of the highlighterObject.

Public Methods

  • bool CanSetHighlighterScaleWithCollider(): Can be checked if the SocketInteractor has a SphereCollider- or BoxCollider-Component, thus useColliderSizeAsScale can be set to true.
  • void SetHighlighterVisible(bool visible): Used to show or hide the highlighterObject. Can be overwritten to modify the behavior of when the highlighter is allowed to be shown.

Protected Methods

  • void UpdateHighlighterScaleWithCollider(): Updates the scale of the highlighterObject if possible.

Inherited Members

Protected Methods

  • void Awake(): Used to setup the highlighterObject and the SocketInteractor itself. Can be overwritten but base.Awake() should be called to ensure correct behavior.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally