toio SDK for Unity Documentation
Development Overview
[1] Setup
- Prepare the development environment “Preparation”
- Create a new project in Unity and load toio SDK for Unity “toio SDK for Unity Installation”
- Optional
[2] Development
- Check before development “How to operate Simulator (Settings for mats and cubes, etc.)”.
- Create a development folder under the Assets folder “Script Dependencies”.
- Create a new scene and load Simulator’s Prefab “Creating Scenes”.
- Programming.
[3] Verifying program in Unity Editor (Connect to simulator or actual device)
- Press the Play button to verify operation in the simulator.
- Set ConnectType to Real (actual device), press the Play button, and connect to the actual device to verify operation.
- Set up Mac BLE first if using Mac
- For specifications and how to set ConnectType, refer to the sample ConnectType.
- Repeat the development and operation verification in Unity Editor to efficiently finalize your program.
[4] Build
- Build an app for a smart device and verify that it works on the device.
-
“iOS Build” “Android Build” “WebGL Build” - For Mac or Windows 10 build, please refer to Unity’s official document.
-
Tutorial
Basics
- 1. Overview
- 2. Creating Scenes
- 3. Move
- 4. Make a sound
- 5. Light up LED
- 6. Read toio ID(Position ID & Standard ID)
- 7. Detect sensors’ events
- 8. Move multiple Cubes
- 9. Simplifying the source code using CubeManager class
- 10. Connection/disconnection on the way
- 11. Creating UI
- 12. How to use in Visual Scripting
Easily control the movement of the cube - CubeHandle
- 1. Basic Usage
- 2. Functions
- 3. Follow TargetPole Demo
Group control - Navigator
- 1. Overview
- 2. Basic Usage
- 3. Avoiding Collisions with CubeNavigator
- 4. Population Control with Boids
- 5. Boids + Conflict Avoidance
Templates
Sample
Basics
-
This sample is to check if the connection settings are different between Simulator and the real environment.
-
This is a collection of samples for connecting to a cube with the specified Local Name.
-
This is a sample to see how the behavior of many Cubes changes depending on the mode of CubeNavigator.
-
This is a sample of how to use CubeNavigator to move multiple Cubes with avoiding collisions.
-
This is a sample that detects each sensor value of Cube and displays it on UI.
-
This is a sample of moving Cube using Cube.TargetMove and Cube.AccelerationMove.
-
This is an example of visualizing the results of HLAvoid calculation of CubeNavigator and all defined walls.
Application
-
This is a sample of using multiple mats together as one large mat.
-
This is a sample of communicating with Cube by directly using BLE interface, which is a low-level module.
-
This is a collection of sample web applications that run in a browser.
-
This sample handles scene transitions while maintaining the connection with the real Cube and the correlated instance with Cube on Simulator.
-
These samples demonstrate a “Digital Twin,” where the movements of a real cube are reflected in real-time on a simulator cube.
Technical Documents
Diagram of the entire system
Explain from low level (left) to high level (right).
- Simulator: A simulator that can be run in Unity Editor
- BLE: A module for bluetooth communication with the real Cube on smart devices or web browser
- Cube: A class that unifies both Simulator and the real world and handles Cube
- CubeHandle: A class that summarizes useful movement functions
- Navigator: A class that provides advanced group control
- CubeManager: A class that usefully manages multiple cubes and various functions