godotVmcSharp/DeviceReceiver.cs

23 lines
582 B
C#
Raw Permalink Normal View History

using System.Collections.Generic;
using Godot;
namespace godotVmcSharp
{
class DeviceReceiver
{
readonly Dictionary<string, Node3D> devices;
public DeviceReceiver()
{
this.devices = new Dictionary<string, Node3D>{};
}
public void ProcessMessage(VmcExtDevicePos message)
{
if (!this.devices.ContainsKey(message.Serial))
{
this.devices.Add(message.Serial, new Node3D());
}
this.devices[message.Serial].Transform = message.Transform;
}
}
2023-10-20 15:52:55 +02:00
}