本文整理汇总了C#中OpenSim.Region.Framework.Scenes.Scene.RezNewScript方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.RezNewScript方法的具体用法?C# Scene.RezNewScript怎么用?C# Scene.RezNewScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.Scene
的用法示例。
在下文中一共展示了Scene.RezNewScript方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RezScript
private void RezScript(Scene scene, UUID soId, string script, string itemName, UUID userId)
{
InventoryItemBase itemTemplate = new InventoryItemBase();
// itemTemplate.ID = itemId;
itemTemplate.Name = itemName;
itemTemplate.Folder = soId;
itemTemplate.InvType = (int)InventoryType.LSL;
// XXX: Ultimately it would be better to be able to directly manipulate the script engine to rez a script
// immediately for tests rather than chunter through it's threaded mechanisms.
AutoResetEvent chatEvent = new AutoResetEvent(false);
scene.EventManager.OnChatFromWorld += (s, c) =>
{
// Console.WriteLine("Got chat [{0}]", c.Message);
chatEvent.Set();
};
scene.RezNewScript(userId, itemTemplate, script);
// Console.WriteLine("HERE");
Assert.IsTrue(chatEvent.WaitOne(60000), "Chat event in HGAssetMapperTests.RezScript not received");
}