本文整理匯總了C#中OpenSim.Tests.Common.SceneHelpers.RezNewScript方法的典型用法代碼示例。如果您正苦於以下問題:C# SceneHelpers.RezNewScript方法的具體用法?C# SceneHelpers.RezNewScript怎麽用?C# SceneHelpers.RezNewScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenSim.Tests.Common.SceneHelpers
的用法示例。
在下文中一共展示了SceneHelpers.RezNewScript方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestAddScript
public void TestAddScript()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UUID userId = TestHelpers.ParseTail(0x1);
// UUID itemId = TestHelpers.ParseTail(0x2);
string itemName = "Test Script Item";
Scene scene = new SceneHelpers().SetupScene();
SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId);
scene.AddNewSceneObject(so, true);
InventoryItemBase itemTemplate = new InventoryItemBase();
itemTemplate.Name = itemName;
itemTemplate.Folder = so.UUID;
itemTemplate.InvType = (int)InventoryType.LSL;
SceneObjectPart partWhereScriptAdded = scene.RezNewScript(userId, itemTemplate);
Assert.That(partWhereScriptAdded, Is.Not.Null);
IEntityInventory primInventory = partWhereScriptAdded.Inventory;
Assert.That(primInventory.GetInventoryList().Count, Is.EqualTo(1));
Assert.That(primInventory.ContainsScripts(), Is.True);
IList<TaskInventoryItem> primItems = primInventory.GetInventoryItems(itemName);
Assert.That(primItems.Count, Is.EqualTo(1));
}