27 lines
659 B
Markdown
27 lines
659 B
Markdown
|
# GlaxOSC
|
||
|
|
||
|
## Usage
|
||
|
```csharp
|
||
|
GlaxOSC.OSC osc = new GlaxOSC.OSC("OSCCollar", new List<GlaxOSC.OSCEndpoint>()
|
||
|
{
|
||
|
new("/avatar/parameters/yourParameter", typeof(float), Callback),
|
||
|
});
|
||
|
osc.OnParameterChangeEvent += OnOscParameterChangeEvent;
|
||
|
|
||
|
[...]
|
||
|
|
||
|
private void Callback(string endpoint, object? oldValue, object? newValue)
|
||
|
{
|
||
|
Console.WriteLine($"{endpoint}: {oldValue} -> {newValue}");
|
||
|
}
|
||
|
|
||
|
private void OnOscParameterChangeEvent(string endpoint, object? oldValue, object? newValue)
|
||
|
{
|
||
|
switch (endpoint)
|
||
|
{
|
||
|
case "/avatar/change":
|
||
|
this._avatarId = (string)(newValue ?? "");
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
```
|