This simple helper script was created to enable the use of OOCSI and Unity. The script allows you to send and receive multi channel data. Tested with Unity 2022.3.2f1.
- Clone the repository into your Assets folder.
- Create an empty object and add
OOCSI.cs
script to the object. - Update your the Server, Port, Unique ID and Channel names (image below).
- To send data, press arrow keys Up, Down and Left to increment three integers, sending to three separate channels.
- Received data on each of the three channels will be displayed on the debug window.
- This script uses Unity's jsonUtility object for wider compatibility. jsonUtility requires users to create a class matching the JSON structure. To update this to match your requirements, edit the
OOCSIMessage.cs
file. - To add or reduce the number of channels subscribed to, use the
SubscribeToChannel()
function. All incoming data is handled inprocessOOCSIMessage()
.