1
0
Glax-VRC-OSC/README.md
2024-09-06 01:09:05 +02:00

659 B

GlaxOSC

Usage

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;
    }
}