本文整理汇总了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);
}
}
}
示例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();
}
}
示例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();
}
}
示例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;
}