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


C# PersonList.GetGameObject方法代码示例

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


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

示例1: LoadPersonIdFromString

        public void LoadPersonIdFromString(PersonList persons, string data)
        {
            char[] separator = new char[] { ' ', '\n', '\r' };
            string[] strArray = data.Split(separator, StringSplitOptions.RemoveEmptyEntries);

            this.person = new Dictionary<int, List<Person>>();
            for (int i = 0; i < strArray.Length; i += 2)
            {
                int n = int.Parse(strArray[i]);
                int pid = int.Parse(strArray[i + 1]);
                if (!this.person.ContainsKey(n))
                {
                    this.person[n] = new List<Person>();
                }
                if (pid != -1)
                {
                    this.person[n].Add(persons.GetGameObject(pid) as Person);
                }
                else
                {
                    this.person[n].Add(null);
                }
            }
        }
开发者ID:simon217,项目名称:ZhongHuaSanGuoZhi,代码行数:24,代码来源:Event.cs

示例2: btnAddDialogFromRelated_Click

 private void btnAddDialogFromRelated_Click(object sender, EventArgs e)
 {
     PersonList list = new PersonList();
     if (this.EditingEvent.LaunchPerson != null)
     {
         list.Add(this.EditingEvent.LaunchPerson);
     }
     if (this.EditingEvent.TargetPersons.Count > 0)
     {
         foreach (PersonRelation relation in this.EditingEvent.TargetPersons)
         {
             list.Add(relation.SpeakingPerson);
         }
     }
     frmSelectPersonList list2 = new frmSelectPersonList();
     list2.Persons = list;
     list2.SelectOne = true;
     list2.ShowDialog();
     if (list2.IDList.Count == 1)
     {
         PersonDialog item = new PersonDialog();
         item.SpeakingPerson = list.GetGameObject(list2.IDList[0]) as Person;
         item.Text = "非空话语";
         this.EditingEvent.Dialogs.Add(item);
         this.RefreshDialogs();
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:27,代码来源:frmEditTroopEvent.cs

示例3: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     PersonList list = new PersonList();
     if (this.EditingEvent.LaunchPerson != null)
     {
         list.Add(this.EditingEvent.LaunchPerson);
     }
     if (this.EditingEvent.TargetPersons.Count > 0)
     {
         foreach (PersonRelation relation in this.EditingEvent.TargetPersons)
         {
             list.Add(relation.SpeakingPerson);
         }
     }
     frmSelectPersonList list2 = new frmSelectPersonList();
     list2.Persons = list;
     list2.SelectOne = true;
     list2.ShowDialog();
     if (list2.IDList.Count == 1)
     {
         TroopEffectPerson item = new TroopEffectPerson();
         item.EffectPerson = list.GetGameObject(list2.IDList[0]) as Person;
         item.Effect = this.cbPersonEffect.Items[0] as GameObjects.TroopDetail.EventEffect.EventEffect;
         this.EditingEvent.EffectPersons.Add(item);
         this.RefreshPersonEffects();
     }
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:27,代码来源:frmEditTroopEvent.cs

示例4: IsFather

 private bool IsFather(PersonList list, Person p, Person subp)
 {
     for (Person person = list.GetGameObject(p.Father) as Person; person != null; person = list.GetGameObject(person.Father) as Person)
     {
         if (person.Father == subp.ID)
         {
             return true;
         }
     }
     return false;
 }
开发者ID:kanjianlema,项目名称:ZhongHuaSanGuoZhi,代码行数:11,代码来源:GameScenario.cs


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