-
-
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
is true
it will be instanced at the attach point of the socket but won't be able to be interacted with. If the component is missing and the non-interactables are disallowed, the putBackPrefab
will be set to null
.
If the socket does not hold an object, it will be disabled.
The socket and putBackPrefab
can be controlled by an Exhibition Display or any other component by setting externallyControlled
to true
. This will lock "PutBack" section of the sockets editor, as it is controlled elsewhere.
-
GameObject putBackPrefab
: The prefab that is displayed at the socket. Will automatically create an instance of the prefab and update the references.
Will reject prefabs without aXRBaseInteractable
-Component andallowNonInteractables
being disabled. -
GameObject putBackInstance
: (Readonly) The current instance of the putBackPrefab. Can not be changed via the editor. -
XRBaseInteractable putBackInstance
: (Readonly) The current interactable of the putBackPrefab. Can not be changed via the editor. May be null if theputBackPrefab
has noXRBaseInteractable
-Component andallowNonInteractables
is true. -
bool allowNonInteractables
: If enabled GameObjects without anXRGrabInteractable
-Component will be allowed to be set asputBackPrefab
. Otherwise those will be cleared. -
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. Default:1.0f
-
bool externallyControlled
: Hidden in the editor! Used to disable certain fields in the editor when controlled by an Exhibition Display.
-
void UpdatePutBackObject()
: Updates theputBackPrefab
by destroying and creating instances, adding/removing listeners and de-/selecting the interactable.
Will be automatically called when settingputBackPrefab
. -
bool ArePutBackReferencesValid()
: Checks if all references derived from the putBackPrefab are valid. -
bool ValidatePutBackPrefab()
: Checks if the putBackPrefab is valid with respect to the current configuration.
-
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