-
-
Notifications
You must be signed in to change notification settings - Fork 2
Exhibition Display
class in ExPresSXR.Presentation / Extends MonoBehavior
GameObject instantiable via ExPresS XR/Presentation/Exhibition Display - ...
The Exhibition Display allows for presentation of objects in the VR in new and interesting ways.
A Exhibition Display can holds a Prefab that is held in a PutBackSocketInteractor
. The displayedPrefab
will be automatically instanced via a socket. This means it can be picked up if it has a XRGrabInteractable
-Component. If needed the object can be rotated automatically.
The display can be augmented with a label and more detailed information.
The label is always show while the info can be shown via a button press on either a "flat" UI button or a 3D-BaseButton
.
The info can be presented as text, image, video and/or audio by providing the respective resources.
The info's visibility can either be toggled or shown for a set period of time. The later can be set but will be longer if a video or audio clip is provided an is longer. In that case it is ensured that the clip is played completely.
Note: If only am image (or rather Sprites) should be displayed create an empty GameObject and add a World Space Canvas. Then an Image with the Sprite itself to the Canvas and save the whole thing as a Prefab.
There are three Exhibition Displays that can be instantiated directly. One designed for images, one for objects and an empty one without any meshes. They can be modified after instancing by editing the ProBuilder-Meshes or adding own Meshes.
-
GameObject displayedPrefab
: The Prefab that is displayed. -
bool spinObject
: If enabled the attached GameObject (or rather theSocketInteractor
will rotate around the up axis) - float putBackTime`: The duration in seconds of how long the displayed GameObject can be outside the socket and while not being selected. If that time passes it will snap back to the socket.
-
string labelText
: The text displayed on the label. -
string infoText
: The text displayed on theinfoCanvas
when the info is visible. -
Sprite infoImage
: The image displayed on theinfoCanvas
when the info is visible. -
AudioClip infoAudioClip
: The audio clip played when info is should be shown. If only an audio clip is presentinfoCanvas
will not be shown. -
VideoClip infoVideoClip
: The video displayed on theinfoCanvas
when the info is visible. -
bool usePhysicalInfoButton
: If enabled the info can be activated via aBaseButton
. If not, a normalUnityEngine.UI.Button
is used. -
bool toggleInfo
: If enabled the info will toggle. Otherwise it will be shown for the duration derived fromshowInfoDuration
. -
float showInfoDuration
: IftoggleInfo
is not enabled this determines the duration of how long the info is shown in seconds. If video or audio clips are specified as info the maximum of this value and the length of the clips (+AFTER_CLIP_TIMEOUT
) is used. -
PutBackSocketInteractor socket
: A Reference to thePutBackSocketInteractor
that is used to attach/instantiate thedisplayedPrefab
. -
TMP_Text labelTextGo
: TheTMP_Text
reference displaying thelabelText
. -
Canvas infoCanvas
: TheCanvas
reference holding all info ui elements. This will be changed when the visibility of the info. -
TMP_Text infoTextGo
: TheTMP_Text
reference displaying theinfoText
. -
Image infoImageGo
: TheImage
reference displaying theinfoImage
. -
AudioSource infoAudioSource
: TheAudioSource
used to play theinfoAudioClip
. -
VideoPlayer infoVideoPlayer
: TheVideoPlayer
used to play theinfoVideoClip
. -
RawImage infoVideoDisplayGo
: TheRawImage
reference displaying theinfoVideoClip
. Instead of reusinginfoImageGo
, aRawImage
is used here as this is more performant. -
Button uiShowInfoButton
: TheUnityEngine.UI.Button
that can be pressed to show the info if enabled. -
Canvas uiShowInfoButtonCanvas
: The canvas theuiShowInfoButton
is attached to. Will be used to change it's visibility. -
worldShowInfoButton
: TheBaseButton
that can be pressed to show the info if enabled. -
BaseButton infoActive
: (readonly) Can be used to check if any info is active (Canvas active, audio or video playing, ...)
-
void ShowInfo()
: Can be used to show the info manually. -
void HideInfo()
: Can be used to hide the info manually. -
float GetInfoActivationDuration()
: Gets the actual duration of how long the info is shown whentoggleInfo = false
. It is the maximum ofshowInfoDuration
and the lengths of the audio and video clips (+AFTER_CLIP_TIMEOUT
).
-
float AFTER_CLIP_TIMEOUT
: Time in seconds that is added to the duration of a video or audio clip when the clip length is determined automatically. This makes the ending appear less harsh.
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