diff --git a/VmcMessages/VmcExtRcv.cs b/VmcMessages/VmcExtRcv.cs index de5fb03..15c00c3 100644 --- a/VmcMessages/VmcExtRcv.cs +++ b/VmcMessages/VmcExtRcv.cs @@ -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{ + new godotOscSharp.OscArgument(enable, 'i'), + new godotOscSharp.OscArgument(port, 'i'), + }); + } + return new godotOscSharp.OscMessage(addr, new List{ + new godotOscSharp.OscArgument(enable, 'i'), + new godotOscSharp.OscArgument(port, 'i'), + new godotOscSharp.OscArgument(ipAddress, 's'), + }); + } } } \ No newline at end of file