TeslasuitDocumentation
Plugins

Demo launcher

Windows · Unity 6000.0.44f1 · Plugin 2.6.0 · Requires Teslasuit Studio

This is the entry point for the whole example project: open it first. Rather than demonstrating a plugin subsystem, it's a hub for browsing every other example scene without leaving play mode, plus a live check that hardware is connected before you dive into one. The scene is TS/Examples/Scenes/RootScene/Root.unity.

What it demonstrates#

  • Switching between example scenes at runtime with ExamplesViewer, a dropdown that additively loads and unloads scenes.
  • A live device connection readout with ConnectedSuitViewer.

Scene setup#

ExamplesViewer holds a UI Dropdown and a list of scene names (m_scenes). Selecting an entry unloads whichever example scene is currently loaded, then additively loads the selected one on top of Root:

private void OnSceneSelected(int index)
{
    indexSelected = index - 1;
    if (currentScene != null)
    {
        var ao = SceneManager.UnloadSceneAsync(currentScene);
        ao.completed += Ao_completed;
    }
    else
    {
        Ao_completed(null);
    }
}

private void Ao_completed(AsyncOperation obj)
{
    if (indexSelected == -1) { currentScene = null; return; }
    SceneManager.LoadScene(m_scenes[indexSelected], LoadSceneMode.Additive);
    currentScene = m_scenes[indexSelected];
}

Because loading is additive, Root itself (and its UI) stays resident while you move between examples.

ConnectedSuitViewer polls a TsSuitBehaviour each frame and writes the result to a Text label: the suit's Ssid once connected, otherwise "Disconnected". Use it to confirm hardware is paired before testing whichever scene you loaded.

Note. GloveMocap.unity additionally carries its own orbit camera (OrbitalCamera, CameraMouseInput, CameraFocusPoint), driven by left-mouse drag, for viewing the tracked hands. See Glove mocap.