Supported Versions: Unity 2021.3 LTS, Unity 2022.3 LTS, Unity 2023.1
How to install
- Create a new folder named "ZeroLight OmniStream" inside the "Packages" folder in your Unity Project
- Copy the contents from the plugins\Unity folder from your plugin download into this new folder
- Unity will detect the package and import it automatically
- With your project's main scene open click Add OmniStream to scene within the ZeroLight menu
- You'll see the ZLCloudPluginModule GameObject has been added to your scene
The ZLCloudPluginModule GameObject automatically gets added to DontDestroyOnLoad so it will persist between Scene changes. If you use Scene reloads as a method of resetting state between connections, then ensure that the GameObjects linked in any events are aslo added to DontDestroyOnLoad, otherwise the links will be broken on Scene reload
For security reasons, OmniStream does not pass through all input from the web broweser, keys have to be explciitly enabled in the plugin settings. A selection of standard keys (WASD etc.) are inclided by default, these can be removed or extra keys added in the Allowed Keys List. To add keys to the Allowed Keys list, press the record button, hit the keys you wish to add on the keyboard, and press stop. Alternatively uoi can manually enter ASCII key codes using an online tool such as https://keycode.info/ to find the relevant code.
Legacy Input System
The Unity Legacy Input System is supported, but does have issues with mouse input when testing locally (due to the way Unity captures the mouse in the legacy system). If practical for your project, we recomend swithcing to the new Input System, which is the default when you install the OmkniStream plugin. To swithc to the Legacy Input System, use the Input Mode dropdown in the OmniStream settings menu.
On Connected Stream
Triggered when a user connects to a stream. This is where the experience should be started, into camera sequences triggered, onboarding information displayed etc.
On Disconnected Stream
Triggered when a user disconnects from a stream for any reason (e.g. browser close, connection drop). This is where any cleanup/resetting of the experience needs to be done, so the experience is ready when the next user connects. When debugging locally the OmniStream systems that normally call this do not run, to simulate this from the browser, call
cloudstream.disconnect() from the browser console.
On Receive Data
Where messages sent from the web page hosting the stream are received. The content of these messages is JSON data, but the schema for the data is not defined by ZeroLight and can be used for whatever data makes sense for your experience. Examples might include UI that is outside of the stream, or for the user to pass some custom text to the experience.
Messages can be sent to the web page hosting the stream. As with Receive Data the content of the messages is an open JSON schema. This can be used to let the web page hosting the stream know something has happened in the experience.