com.hecomi.uosc
Advanced tools
Comparing version 1.1.0 to 2.0.0
{ | ||
"name": "com.hecomi.uosc", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"displayName": "uOSC", | ||
@@ -5,0 +5,0 @@ "description": "A simple implementation of the OSC protocol", |
uOSC | ||
==== | ||
![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat) | ||
**uOSC** is an OSC implementation for Unity. | ||
Platforms | ||
--------- | ||
- Windows | ||
- Mac | ||
- HoloLens | ||
I've not checked Android and iOS yet... | ||
Install | ||
------- | ||
Download the latest `.unitypackage` from [Release page](https://github.com/hecomi/uOSC/releases) | ||
and import it into your Unity project. | ||
- Unity Package | ||
- Download the latest .unitypackage from [Release page](https://github.com/hecomi/uOSC/releases). | ||
- Git URL (UPM) | ||
- Add `https://github.com/hecomi/uOSC.git#upm` to Package Manager. | ||
- Scoped Registry (UPM) | ||
- Add a scoped registry to your project. | ||
- URL: `https://registry.npmjs.com` | ||
- Scope: `com.hecomi` | ||
- Install uOSC in Package Manager. | ||
Alternatively, add `https://github.com/hecomi/uOSC.git#upm` to Package Manager. | ||
How to use | ||
@@ -30,4 +24,5 @@ ---------- | ||
1. Attach `uOscServer` component to GameObject. | ||
2. Register `uOscServer.onDataReceived` event. | ||
1. Attach `uOscServer` component to a GameObject. | ||
2. Set the port you want to listen on. | ||
3. Register the `uOscServer.onDataReceived` event (from code or inspector). | ||
@@ -65,7 +60,5 @@ ```cs | ||
`onDataReceived` is called from the Unity main thread, so you can use Unity APIs inside it. | ||
`onDataReceived` is called from the main Unity thread, so you can use the Unity APIs in it. | ||
OSC Bundle is automatically expanded, and each message comes to | ||
the `onDataReceived` event handler directly, so you don't have to check | ||
whether the value is a OSC Message or OSC Bundle. | ||
Since the OSC Bundle is automatically expanded and each message comes directly to the `onDataReceived` event handler, there is no need to check whether the value is an OSC Message or an OSC Bundle. | ||
@@ -91,9 +84,42 @@ ### Client | ||
UI | ||
-- | ||
<img src="https://raw.githubusercontent.com/wiki/hecomi/uOSC/uOSC-UI.png" width="720" /> | ||
Tips | ||
---- | ||
### Start / Stop manually | ||
### Start / Stop | ||
If you want to start and stop uOSC in runtime, please toggle the `enable` flag of `uOscServer` or `uOscClient`. | ||
If `autoStart` of `uOscServer` is true, the server will start automatically at runtime. If you want to start it manually, you can set it to false and call `StartServer()`; calling `StopServer()` will stop the server. If you want to start and stop from the inspector, toggle the checkbox of the component. | ||
### Change address and port dynamically | ||
If the `port` or `address` of `uOscClient` / `uOscServer` is changed, the server or client will be restarted automatically. If you want to detect when a server or client starts or stops, register listeners to `uOscServer.onServerStarted` / `uOscServer.onServerStopped` / `uOscClient.onClientStarted` / `uOscClient.onClientStopped` events. | ||
### Queue Size | ||
`uOscClient.Send()` is not executed immediately, but is registered in a queue, and is retrieved from the queue and sent in a background thread. If a large number of `Send()` are called at the same time, messages that exceed `uOscClient.maxQueueSize` will be automatically discarded. In this case, you should change `uOscClient.maxQueueSize` to a larger value. The interval of the background thread processing is about 1 ms by default. | ||
### Data transmission interval | ||
If you need to send multiple large `byte[]` data at the same time, there are cases where you will lose packets frequently if you do not allow an interval. In this case, set `uOscClient.dataTransmissionInterval` (seconds). The background thread waits for the interval between each time a message is sent. | ||
### Maximum data size | ||
The maximum packet size that can be sent is determined by the UDP spec, which is 65535 bytes minus the size of the UDP and OSC headers. If you want to divide packets to send larger data, please refer to [uPacketDivision](https://github.com/hecomi/uPacketDivision). | ||
### No message from other devices | ||
Please check your firewall settings. | ||
### Backward compatibility | ||
Various features have been added since v2, but backward compatibility with v1 has been maintained. | ||
Examples | ||
-------- | ||
### Send texture | ||
@@ -240,6 +266,1 @@ | ||
``` | ||
### Increase buffer size | ||
If you want to increaset the size of buffer, please edit the `uOscClient.BufferSize` directly (default is 8192). | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128101
80
263