1
0
Glax-VRC-OSC/README.md

27 lines
659 B
Markdown
Raw Normal View History

2024-09-06 01:09:05 +02:00
# 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;
}
}
```