Skip to content

Exhibition Display

eisclimber edited this page Nov 3, 2024 · 4 revisions

Exhibition Display

class in ExPresSXR.Presentation / Extends MonoBehavior
GameObject instantiable via ExPresS XRExhibition Display - ...

Description

The Exhibition Display allows for presentation of objects in the VR in new and interesting ways.

A Exhibition Display can holds a displayedPrefab that is held in a PutBackSocketInteractor. This means it can be picked up if it has a XRGrabInteractable-Component. If needed the object can be rotated automatically.

The configured sockets editor will be locked so that its putBackPrefab and other configuration will be properly reflected.

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 five Exhibition Displays that can be instantiated directly. One designed for images, two for objects, one as an info stand and an empty one without any meshes. They can be modified after instancing by editing the ProBuilder-Meshes or adding own Meshes.

Members

Public Properties

  • GameObject displayedPrefab: The Prefab that is displayed.
  • bool spinObject: If enabled the attached GameObject (or rather the SocketInteractor 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 the infoCanvas when the info is visible.
  • Sprite infoImage: The image displayed on the infoCanvas when the info is visible.
  • AudioClip infoAudioClip: The audio clip played when info is should be shown. If only an audio clip is present infoCanvas will not be shown.
  • VideoClip infoVideoClip: The video displayed on the infoCanvas when the info is visible.
  • bool usePhysicalInfoButton: If enabled the info can be activated via a BaseButton. If not, a normal UnityEngine.UI.Button is used.
  • bool toggleInfo: If enabled the info will toggle. Otherwise it will be shown for the duration derived from showInfoDuration.
  • float showInfoDuration: If toggleInfo 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 the PutBackSocketInteractor that is used to attach/instantiate the displayedPrefab. Will lock the socket when set, preventing users from changing the properties from the socket's editor.
  • TMP_Text labelTextGo: The TMP_Text reference displaying the labelText.
  • Canvas infoCanvas: The Canvas reference holding all info ui elements. This will be changed when the visibility of the info.
  • TMP_Text infoTextGo: The TMP_Text reference displaying the infoText.
  • Image infoImageGo: The Image reference displaying the infoImage.
  • AudioSource infoAudioSource: The AudioSource used to play the infoAudioClip.
  • VideoPlayer infoVideoPlayer: The VideoPlayer used to play the infoVideoClip.
  • RawImage infoVideoDisplayGo: The RawImage reference displaying the infoVideoClip. Instead of reusing infoImageGo, a RawImage is used here as this is more performant.
  • Button uiShowInfoButton: The UnityEngine.UI.Button that can be pressed to show the info if enabled.
  • Canvas uiShowInfoButtonCanvas: The canvas the uiShowInfoButton is attached to. Will be used to change it's visibility.
  • worldShowInfoButton: The BaseButton 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, ...)

Public Methods

  • 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 when toggleInfo = false. It is the maximum of showInfoDuration and the lengths of the audio and video clips (+ AFTER_CLIP_TIMEOUT).

Constants

  • 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.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally