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


C# GameObjectList.HasGameObject方法代码示例

本文整理汇总了C#中GameObjects.GameObjectList.HasGameObject方法的典型用法代码示例。如果您正苦于以下问题:C# GameObjectList.HasGameObject方法的具体用法?C# GameObjectList.HasGameObject怎么用?C# GameObjectList.HasGameObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameObjects.GameObjectList的用法示例。


在下文中一共展示了GameObjectList.HasGameObject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RefreshWithPersonList

 public void RefreshWithPersonList(GameObjectList personList)
 {
     Point position = this.Position;
     Point destination = this.Destination;
     Point realDestination = this.RealDestination;
     Architecture startingArchitecture = this.StartingArchitecture;
     int iD = base.ID;
     Person leader = this.Leader;
     Stunt currentStunt = this.CurrentStunt;
     int stuntDayLeft = this.StuntDayLeft;
     this.Destroy();
     this.Destroyed = false;
     this.realDestination = realDestination;
     this.destination = destination;
     this.position = position;
     this.StartingArchitecture = startingArchitecture;
     base.ID = iD;
     this.Persons.Clear();
     if (!personList.HasGameObject(leader))
     {
         if (personList.Count > 1)
         {
             personList.PropertyName = "FightingForce";
             personList.IsNumber = true;
             personList.ReSort();
         }
         this.Leader = personList[0] as Person;
     }
     foreach (Person person2 in personList)
     {
         this.AddPerson(person2);
     }
     this.Persons.ApplyInfluences();
     if ((currentStunt != null) && (stuntDayLeft > 0))
     {
         this.CurrentStunt = currentStunt;
         this.StuntDayLeft = stuntDayLeft;
     }
     this.Initialize();
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:40,代码来源:Troop.cs

示例2: SetSelected

 public void SetSelected(GameObjectList gameObjectList)
 {
     foreach (GameObject gameObject in this.gameObjects)
     {
         if (gameObjectList.HasGameObject(gameObject))
         {
             gameObject.Selected=true;
         }
     }
 }
开发者ID:ptmaster,项目名称:ZhongHuaSanGuoZhi,代码行数:10,代码来源:GameObjectList.cs

示例3: BuildSectionByArchitectureList

 private void BuildSectionByArchitectureList(GameObjectList architecturelist)
 {
     if (architecturelist.Count != 0)
     {
         Section section;
         GameObjectList list;
         if (architecturelist.Count == 1)
         {
             section = new Section();
             section.ID = base.Scenario.Sections.GetFreeGameObjectID();
             section.Scenario = base.Scenario;
             this.AddSection(section);
             base.Scenario.Sections.AddSectionWithEvent(section);
             list = base.Scenario.GameCommonData.AllSectionAIDetails.GetSectionAIDetailsByConditions(SectionOrientationKind.无, true, false, true, true, false);
             if (list.Count > 0)
             {
                 section.AIDetail = list[GameObject.Random(list.Count)] as SectionAIDetail;
             }
             else
             {
                 section.AIDetail = base.Scenario.GameCommonData.AllSectionAIDetails.GetSectionAIDetailList()[0] as SectionAIDetail;
             }
             section.AddArchitecture(architecturelist[0] as Architecture);
         }
         else
         {
             architecturelist.PropertyName = "Population";
             architecturelist.IsNumber = true;
             architecturelist.ReSort();
             int count = 0;
             int num2 = 2 + (this.ArchitectureCount / 8);
             if (architecturelist.Count < ((num2 * 3) / 2))
             {
                 count = architecturelist.Count;
             }
             else
             {
                 count = num2;
             }
             section = new Section();
             section.ID = base.Scenario.Sections.GetFreeGameObjectID();
             section.Scenario = base.Scenario;
             this.AddSection(section);
             base.Scenario.Sections.AddSectionWithEvent(section);
             list = base.Scenario.GameCommonData.AllSectionAIDetails.GetSectionAIDetailsByConditions(SectionOrientationKind.无, true, false, true, true, false);
             if (list.Count > 0)
             {
                 section.AIDetail = list[GameObject.Random(list.Count)] as SectionAIDetail;
             }
             else
             {
                 section.AIDetail = base.Scenario.GameCommonData.AllSectionAIDetails.GetSectionAIDetailList()[0] as SectionAIDetail;
             }
             Architecture architecture = architecturelist[0] as Architecture;
             section.AddArchitecture(architecture);
             if (architecture.ClosestArchitectures == null)
             {
                 architecture.GetClosestArchitectures();
             }
             if (architecture.AIAllLinkNodes.Count == 0)
             {
                 architecture.GenerateAllAILinkNodes(2);
             }
             foreach (LinkNode node in architecture.AIAllLinkNodes.Values)
             {
                 if (node.Level > 2)
                 {
                     break;
                 }
                 if ((node.A.BelongedFaction == this) && architecturelist.HasGameObject(node.A))
                 {
                     section.AddArchitecture(node.A);
                 }
                 if (section.ArchitectureCount >= count)
                 {
                     break;
                 }
             }
             if (count == architecturelist.Count)
             {
                 if (section.ArchitectureCount < count)
                 {
                     foreach (Architecture architecture2 in section.Architectures)
                     {
                         architecturelist.Remove(architecture2);
                     }
                     if (this.SectionCount == 1)
                     {
                         foreach (Architecture architecture2 in architecturelist)
                         {
                             this.FirstSection.AddArchitecture(architecture2);
                         }
                     }
                     else
                     {
                         foreach (Architecture architecture2 in architecturelist)
                         {
                             int num3 = 0x7fffffff;
                             Section section2 = null;
                             foreach (Section section3 in this.Sections)
//.........这里部分代码省略.........
开发者ID:kanjianlema,项目名称:ZhongHuaSanGuoZhi,代码行数:101,代码来源:Faction.cs


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