Skip to the content.

How to operate Simulator (Settings for mats and cubes, etc.)

Table of Contents


1. Overview

When developing an application for a smart device that communicates with Cube, it is very useful to have an environment to easily check the behavior of the application in Unity Editor. Therefore, toio SDK for Unity provides a simulator as a virtual environment for testing.

This document is the first step in explaining how to use toio SDK for Unity with Unity Editor. Please refer to Usage - Simulator in the technical documentation for detailed usage (mainly API) for development.

Composition

Simulator consists of the following four prefabs under Assets/toio-sdk/Scripts/Simulator/Prefabs/.

Mat, StandardID, and Cube are mock-ups of the real thing, and can be placed in Unity scene as needed.

A Stage is a set of things you need in your Unity scene, usually if you only use one mat, plus some convenience features. All of the tutorials use Stage.

2. Mat Prefab

Mat Prefab is a game object that resembles various play mats.

Cube Prefab can be placed in Mat Prefab to get the coordinate position and orientation of the Mat.

You can place multiple Mat Prefab in a scene, at any position and angle, as long as they are horizontal.

Inspector

In Unity’s Inspector, from the “Type” list of the script Mat.cs

from the “Type” list of the script Mat.cs in Unity inspector to change the mat’s appearance and coordinates.

For specifications of each type, please refer to toio™ Core Cube Technical Specifications and “Developer’s Mat (tentative name)”.

For customization instructions, please refer to “How to Use - Simulator”.

3. StandardID Prefab

The StandardID Prefab is a game object that resembles various card sheets that can read Standard IDs.

If you place Cube Prefab on top of a StandardID Prefab, you can get the Standard ID and orientation.

You can place multiple StandardID Prefabs in a scene, at any position and angle.

Inspector

In Unity inspector, you can select the “Title” of the script Mat.cs, and then select a card sheet of a specific “Type” to switch the StandardID.

The supported “Titles” are as follows

For more information about “Type”, please refer to toio™ Core Cube Technical Specifications.

4. Cube Prefab

Cube Prefab is a game object that resembles a toio™ Core Cube.

There are some functional differences from the actual Cube.
For details, please check Functionality Support.

Inspector in CubeSimulator

It is divided into two parts: [Simulator Settings] and [Manually Change Cube Status].

Setting up Simulator

Manually change the state of Cube

It is displayed only at runtime.

Since it is too difficult to reproduce realistically in simulation, you can use the inspector to change the state of Cube and trigger the corresponding events.

Operations on Cube Objects

While Simulator is running, you can manipulate Cube objects with the mouse.

Operation Description
Left click Press the button on Cube
Right click Lift Cube / Release Cube
Wheel while lifting Change the angle of Cube
Right drag Pulling Cube by force

For more information, please refer to the technical document “Simulator” 4.5. Cube Object Manipulation (CubeInteraction).

5. Stage Prefab

The Stage Prefab is a set of the following objects

In addition, the Stage Prefab has the following two useful tools

If you create a new scene, it is recommended that you delete the cameras and lights already in the scene before adding the Stage Prefab, since the field of view encompasses the cameras and lights that fit into the mat. Also, Stage is just a convenience, not a requirement to use Simulator.

Operations on Stage

Operation Description
Ctrl+Left click Focus on the selected Cube / Unfocus
Ctrl+right click Set and cancel “Target Pole” at the specified position.

For more information, please refer to “Simulator” “5. Stage-Prefab” in the technical documentation.