The mini project of MyXRIoT is dedicated to make an example of combining Unity, Android app, and OneM2M. The purpose is to show a color ball in the XR world with a command in the android app. The OneM2M standard resource tree will be used for connecting the data between unity and android app.
Fig1. The three colors are yellow, blue, and red with the value 1, 2, and 3. If the android app sent value 3, the scene only shows the red ball.
Fig2. After the game started, the balls are initially unvisible. The scripts can read the value from OM2M and make a correspond ball be visible.
Fig3. First, place your OM2M Server IP address into the IP textbox and press Enter.
After showing your IP address below, you can type in a value representing the ball color.
As soon as you send your value, it will be stored inside the OM2M resource tree.
Fig4. The codeblock of GiveUNITYColor.apk
Fig5. The Resource tree records the data that was sent. Here is the MN-CSE resource tree, you can see the Attribute is "Color" and the Value is "3".
- Via the aid of the aid of notion wensite https://abounding-monkey-e51.notion.site/OM2M-d07323a8e2c047d88b9ef74c47fd5d77, you can eventually create your own onem2m website.
- Building the Node-Red by modifying the example from hackmd website https://hackmd.io/@p76081514/B1jIllgfP.
- If you follow the instructions and modify properly, the OM2M website will be built inside your linux VMware.
- Install GiveUNITYColor.apk into smartphone simulator
- Create an empty project in Unity, the ball materials , scripts , and scenes are provided, add them in to the project.
When the user send the value from GiveUNITYColor app, Node-Red in linux VMware post the value to particular container.
Unity HTTP Server is created as well as the subscription to the OM2M container when starting the game.
Unity MainThreadDispatcher set the corresponding color ball in active, the user can observe the color ball appears.
Only personal usage.
Please contact me via github.