本文整理汇总了C#中Hex.RemoveWarnings方法的典型用法代码示例。如果您正苦于以下问题:C# Hex.RemoveWarnings方法的具体用法?C# Hex.RemoveWarnings怎么用?C# Hex.RemoveWarnings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hex
的用法示例。
在下文中一共展示了Hex.RemoveWarnings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Death
//What happens when you die?
void Death(Hex habitat)
{
int i = habitats.IndexOf(habitat);
//print ("Critter#" + number + " Died out in Hex# " + habitat.GetNumber() + ".\r\n");
StopCoroutine("Eat");
StopCoroutine("Breed");
StopCoroutine("Cleanup");
UpdateStats();
adultPopulations.RemoveAt(i);
adultPopulations.TrimExcess();
cubPopulations.RemoveAt(i);
cubPopulations.TrimExcess();
babyPopulations.RemoveAt(i);
babyPopulations.TrimExcess();
habitats.Remove(habitat);
habitats.TrimExcess();
habitat.localCritters.Remove(this);
habitat.localCritters.TrimExcess();
if(isPlayer){
habitat.SetPlayerHab(false);
habitat.RemoveWarnings();
}
for(int n = 0; n < tokenList.Count; n++){
Token token = tokenList[n];
if(token.GetHex() == habitat){
token.Die();
}
}
}
示例2: Migrate
public void Migrate(Hex newHabitat, Hex oldHabitat)
{
int oldHabIndex = habitats.IndexOf(oldHabitat);
int cost = 1;
if(migrationTokens >= cost && !newHabitat.localCritters.Contains(this)){
migrationTokens -= cost;
if (isPlayer)
{
CheckMigrationAnimationState(migrationTokens);
}
habitats.Add(newHabitat);
adultPopulations.Add(adultPopulations[oldHabIndex]);
cubPopulations.Add(cubPopulations[oldHabIndex]);
babyPopulations.Add(babyPopulations[oldHabIndex]);
newHabitat.localCritters.Add(this);
newHabitat.localCritters.TrimExcess();
adultPopulations[oldHabIndex] = 0;
cubPopulations[oldHabIndex] = 0;
babyPopulations[oldHabIndex] = 0;
Death(oldHabitat);
tokenList.TrimExcess();
foreach(Token token in tokenList){
if(token.GetHex() == oldHabitat){
StopCoroutine("Wander");
token.SetHex(newHabitat);
token.gameObject.transform.SetParent(newHabitat.transform);
token.StartCoroutine("Wander");
}
}
oldHabitat.localCritters.TrimExcess();
if(isPlayer){
oldHabitat.SetPlayerHab(false);
newHabitat.SetPlayerHab(true);
oldHabitat.RemoveWarnings();
}
}
//print("Critter# " + number + " Migrated from Hex# " + oldHabitat + " to Hex# " + newHabitat + ".\r\n");
}