-
-
Notifications
You must be signed in to change notification settings - Fork 2
Put Back Socket Interactor
class in ExPresSXR.Interaction / Extends class in ExPresSXR.Interaction.HighlightableSocketInteractor GameObject instantiable via ExPresS XR/Put Back Socket Interactor
An Expansion of the HighlightableSocketInteractor
to restrict access to a single GameObject an instance of the putBackPrefab
. After a certain amount of time outside the interactor and not being held or selected elsewhere, the object will be snap back to this socket.
The putBackPrefab
will be automatically be instanced. If it does not have a XRGrabInteractable
-Component and allowNonInteractables = true
it will be instanced at the attach point of the socket but won't be able to be interacted with.
If the socket does not hold an object, it will be disabled.
-
GameObject putBackPrefab
: The prefab that is displayed at the socket. Will automatically create an instance of the prefab and update the references. -
bool allowNonInteractables
: If enabled GameObjects without anXRGrabInteractable
-Component will be allowed to be set asputBackPrefab
. Otherwise those will be cleared. -
putBackObjectInstance
: (readonly) A reference to the instance of the currentputBackPrefab
. If this instance could not be created (putBackPrefab = null
) the socket will be disabled. -
XRGrabInteractable putBackInteractable
: (readonly) A reference to theXRGrabInteractable
of the currentputBackPrefab
. -
float putBackTime
: The duration in seconds how long the put back object can be unselected outside the socket until being snapped back to the socket. If less or equal to 0, the object will snap back instantaneous.
-
void UpdatePutBackObject()
: Updates theputBackPrefab
by destroying and creating instances, adding/removing listeners and de-/selecting the interactable. Will be automatically called when settingputBackPrefab
.
-
void Awake()
: Deactivates the socket if noputBackObjectInstance
could be created and sets up the inherited socket classes. Can be overwritten butbase.Awake()
should be called to ensure correct behavior. -
void OnEnable()
: Resets the putBackObject when rebuilding to prevent errors. Can be overwritten butbase.OnEnable()
should be called to ensure correct behavior. -
bool CanHover(IXRHoverInteractable interactable)
: Determines if aXRGrabInteractable
can hover, e.g. is considered a valid target. Can be overwritten butbase.CanHover(interactable)
should be called to ensure correct behavior. -
bool CanSelect(IXRSelectInteractable interactable)
: Determines if aXRGrabInteractable
can be selected, e.g. is considered a valid target. Can be overwritten butbase.CanSelect(interactable)
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