Device state management tutorial

Device state management

This section describes how to manage the device status with the Unity app.

  1. Create a Unity project and import the package

    Refer to Create a Unity project for how to create

  2. Drag and drop MoverioInfo into the hierarchy window

  3. Create a script

  4. Add using

    Open the script created in 3 and describe as using MoverioBasicFunctionUnityPlugin;

    using MoverioBasicFunctionUnityPlugin;
  5. Call the function

    Describe the API you want to use like MoverioInfo.GetHeadsetSerialNumber

    Refer to the following script for the description method of each function.

    Label Script
    Headset serial number GetSerialNumberController.cs
    Headset product name GetProductNameController.cs
  6. Attach the script to the GameObject

Please refer to API Reference for API specifications.

Headset system status notification

This section describes how to receive the headset system status notification in the Unity app.

  1. Create a Unity project and import the package

    Refer to Create a Unity project for how to create

  2. Drag and drop MoverioInfo into the hierarchy window

  3. Create a script

  4. Create a function to be notified of headset connection/disconnection

    public void OnHeadsetAttached()
    {
    }
    
    public void OnHeadsetDetached()
    {
    }
  5. Attach the script to the GameObject

  6. Click MoverioInfo in the hierarchy window

  7. Add an event by clicking “+” of On Headset Attached or On HeadSset Detached of Moverio Info (Script) in the Inspector of MoverioInfo

  8. Drag and drop the GameObject to which the script is attached in step 5 in the hierarchy window to the event.

  9. Select the function to receive the On Headset Attached or On Headset Detached event notification