当前位置: 首页>>代码示例>>C#>>正文


C# IScene.ForEachSceneEntity方法代码示例

本文整理汇总了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);
            }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:53,代码来源:Backup.cs

示例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");
 }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:15,代码来源:Backup.cs

示例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);
                                                           }
                                                       }
                                                   });
        }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:19,代码来源:Backup.cs

示例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);
 }
开发者ID:skidzTweak,项目名称:HyperGrid,代码行数:6,代码来源:UserManagementService.cs


注:本文中的IScene.ForEachSceneEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。