本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectGroup.DelinkFromGroup方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectGroup.DelinkFromGroup方法的具体用法?C# SceneObjectGroup.DelinkFromGroup怎么用?C# SceneObjectGroup.DelinkFromGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.SceneObjectGroup
的用法示例。
在下文中一共展示了SceneObjectGroup.DelinkFromGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestDelinkPersistence
public void TestDelinkPersistence()
{
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
TestScene scene = SceneHelpers.SetupScene();
string rootPartName = "rootpart";
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
string linkPartName = "linkpart";
UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000");
SceneObjectPart rootPart
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = rootPartName, UUID = rootPartUuid };
SceneObjectPart linkPart
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = linkPartName, UUID = linkPartUuid };
SceneObjectGroup sog = new SceneObjectGroup(rootPart);
sog.AddPart(linkPart);
scene.AddNewSceneObject(sog, true);
// In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked
// scene backup thread.
scene.Backup(true);
// These changes should occur immediately without waiting for a backup pass
SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false);
Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.True);
scene.DeleteSceneObject(groupToDelete, false);
Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.False);
List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID);
Assert.That(storedObjects.Count, Is.EqualTo(1));
Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(1));
Assert.That(storedObjects[0].ContainsPart(rootPartUuid));
}
示例2: TestDelinkPersistence
public void TestDelinkPersistence()
{
TestHelpers.InMethod();
//log4net.Config.XmlConfigurator.Configure();
TestScene scene = new SceneHelpers().SetupScene();
string rootPartName = "rootpart";
UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
string linkPartName = "linkpart";
UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000");
SceneObjectPart rootPart
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = rootPartName, UUID = rootPartUuid };
SceneObjectPart linkPart
= new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero)
{ Name = linkPartName, UUID = linkPartUuid };
SceneObjectGroup linkGroup = new SceneObjectGroup(linkPart);
scene.AddNewSceneObject(linkGroup, true);
SceneObjectGroup sog = new SceneObjectGroup(rootPart);
scene.AddNewSceneObject(sog, true);
Assert.IsFalse(sog.GroupContainsForeignPrims);
sog.LinkToGroup(linkGroup);
Assert.IsTrue(sog.GroupContainsForeignPrims);
scene.Backup(true);
Assert.AreEqual(1, scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID).Count);
// These changes should occur immediately without waiting for a backup pass
SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false);
Assert.IsFalse(groupToDelete.GroupContainsForeignPrims);
/* backup is async
scene.DeleteSceneObject(groupToDelete, false);
List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID);
Assert.AreEqual(1, storedObjects.Count);
Assert.AreEqual(1, storedObjects[0].Parts.Length);
Assert.IsTrue(storedObjects[0].ContainsPart(rootPartUuid));
*/
}