-
-
Notifications
You must be signed in to change notification settings - Fork 2
Highlightable Socket Interactor
eisclimber edited this page Jan 18, 2024
·
1 revision
class in ExPresSXR.Interaction / Extends UnityEngine.XR.Interaction.Toolkit.XRSocketInteractor
GameObject instantiable via ExPresS XR/Highlightable Socket Interactor
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
.
-
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 thehighlighterObject
will grow according to the socket interactors' collider size (only if it has aSphereCollider
- orBoxCollider
-Component). The scale will be a little bit smaller to prevent z-index fighting. -
Vector3 highlighterScale
: IfuseColliderSizeAsScale
is not enabled, the scale of thehighlighterObject
.
-
bool CanSetHighlighterScaleWithCollider()
: Can be checked if the SocketInteractor has aSphereCollider
- orBoxCollider
-Component, thususeColliderSizeAsScale
can be set to true. -
void SetHighlighterVisible(bool visible)
: Used to show or hide thehighlighterObject
. Can be overwritten to modify the behavior of when the highlighter is allowed to be shown.
-
void UpdateHighlighterScaleWithCollider()
: Updates the scale of thehighlighterObject
if possible.
-
void Awake()
: Used to setup thehighlighterObject
and theSocketInteractor
itself. Can be overwritten butbase.Awake()
should be called to ensure correct behavior.
Autor: Luca 'eisclimber' Dreiling; License: MIT
- Getting Started
- Development and Contribution
- Misc
- Experimentation
- Data Gatherering
- Eye Tracking
- ExPresS XR Rig
- Interaction
- Base Button
- Button Quiz
- Collision Hand Rumbler
- Collision Sound Emitter
- Exit Game Interactable (Script Deprecated)
- Interactables
- Haptic Impulse Trigger
- Socket Interactors
- Inverse Kinematics
- Localization
- Minigames
- Coin Scale
- Coin Throw
- Sword Cleaning
- Misc
- Movement
- Presentation
- UI