本文整理汇总了C#中IScene.ForEachSceneEntity方法的典型用法代码示例。如果您正苦于以下问题:C# IScene.ForEachSceneEntity方法的具体用法?C# IScene.ForEachSceneEntity怎么用?C# IScene.ForEachSceneEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScene
的用法示例。
在下文中一共展示了IScene.ForEachSceneEntity方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleDeleteObject
private void HandleDeleteObject(IScene scene, string[] cmd)
{
if (cmd.Length < 4)
return;
string mode = cmd[2];
string o = cmd[3];
List<ISceneEntity> deletes = new List<ISceneEntity>();
UUID match;
switch (mode)
{
case "owner":
if (!UUID.TryParse(o, out match))
return;
scene.ForEachSceneEntity(delegate(ISceneEntity g)
{
if (g.OwnerID == match && !g.IsAttachment)
deletes.Add(g);
});
break;
case "creator":
if (!UUID.TryParse(o, out match))
return;
scene.ForEachSceneEntity(delegate(ISceneEntity g)
{
if (g.RootChild.CreatorID == match && !g.IsAttachment)
deletes.Add(g);
});
break;
case "uuid":
if (!UUID.TryParse(o, out match))
return;
scene.ForEachSceneEntity(delegate(ISceneEntity g)
{
if (g.UUID == match && !g.IsAttachment)
deletes.Add(g);
});
break;
case "name":
scene.ForEachSceneEntity(delegate(ISceneEntity g)
{
if (g.RootChild.Name == o && !g.IsAttachment)
deletes.Add(g);
});
break;
}
MainConsole.Instance.Warn("Deleting " + deletes.Count + " objects.");
DeleteSceneObjects(deletes.ToArray(), true, true);
}
示例2: OffsetPrims
public void OffsetPrims(IScene scene, string[] cmdParams)
{
if (cmdParams.Length < 6)
{
MainConsole.Instance.Info("Not enough parameters");
return;
}
Vector3 offset = new Vector3(float.Parse(cmdParams[3]), float.Parse(cmdParams[4]), float.Parse(cmdParams[5]));
scene.ForEachSceneEntity(delegate(ISceneEntity entity)
{
entity.AbsolutePosition += offset;
entity.ScheduleGroupTerseUpdate();
});
MainConsole.Instance.Info("Region has been offset");
}
示例3: EditScale
public void EditScale(IScene scene, string[] cmdparams)
{
scene.ForEachSceneEntity(delegate(ISceneEntity entity)
{
foreach (ISceneChildEntity child in entity.ChildrenEntities())
{
if (child.Name == cmdparams[2])
{
child.Resize(
new Vector3(Convert.ToSingle(cmdparams[3]),
Convert.ToSingle(cmdparams[4]),
Convert.ToSingle(cmdparams[5])));
MainConsole.Instance.InfoFormat(
"Edited scale of Primitive: {0}", child.Name);
}
}
});
}
示例4: EventManager_OnStartupFullyComplete
void EventManager_OnStartupFullyComplete(IScene scene, List<string> data)
{
// let's sniff all the user names referenced by objects in the scene
MainConsole.Instance.DebugFormat ("[USER MANAGEMENT MODULE]: Caching creators' data from {0} ({1} objects)...", scene.RegionInfo.RegionName, scene.Entities.Count);
scene.ForEachSceneEntity (CacheCreators);
}