add ToMessage() to VmcExtRcv

This commit is contained in:
Cassandra de la Cruz-Munoz 2023-08-17 09:39:28 -04:00
parent 4267927352
commit c1825dad14

View File

@ -18,6 +18,7 @@
using Godot;
using godotOscSharp;
using System.Collections.Generic;
namespace godotVmcSharp
{
@ -100,5 +101,21 @@ namespace godotVmcSharp
port = _port;
ipAddress = _ipAddress;
}
public godotOscSharp.OscMessage ToMessage()
{
if (ipAddress == null)
{
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(enable, 'i'),
new godotOscSharp.OscArgument(port, 'i'),
});
}
return new godotOscSharp.OscMessage(addr, new List<godotOscSharp.OscArgument>{
new godotOscSharp.OscArgument(enable, 'i'),
new godotOscSharp.OscArgument(port, 'i'),
new godotOscSharp.OscArgument(ipAddress, 's'),
});
}
}
}