本文整理汇总了C#中OscMessage.Add方法的典型用法代码示例。如果您正苦于以下问题:C# OscMessage.Add方法的具体用法?C# OscMessage.Add怎么用?C# OscMessage.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OscMessage
的用法示例。
在下文中一共展示了OscMessage.Add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
void Update()
{
// Send a message with one float argument.
oscOut.Send( "/test1", Random.value );
// Send a message with a number of assorted argument types.
oscOut.Send( "/test2", Random.value, "Text", false );
// Create a message and send it.
OscMessage message = new OscMessage( "/test3" );
message.Add( "Allo" );
message.Add( "World" );
message.args[0] = "Hello"; // Let's say we want overwrite the first argument
oscOut.Send( message );
}
示例2: Update
void Update()
{
// If we are going to send 'as bundle', then we would like OSC io
// to add the timetag to the messeges contained in the bundle.
oscIn.addTimeTagsToBundledMessages = sendAsBundle;
// Create a messege
OscMessage message = new OscMessage( address );
// Create a timetag. Default time is DateTime.Now.
OscTimeTag timetag = new OscTimeTag();
// Make it 1 milisecond into the future.
timetag.time = timetag.time.AddMilliseconds( 1 );
// Two possible methods for sending timetags ...
if( sendAsBundle )
{
// Either create a bundle with the timetag, add the message and send.
OscBundle bundle = new OscBundle( timetag );
bundle.Add( message );
oscOut.Send( bundle );
} else {
// Or add the timetag to message and send it.
message.Add( timetag );
oscOut.Send( message );
}
// Update label.
sendLabel.text = timetag.time + ":" + timetag.time.Millisecond;
}