public void DisengageDuel(AllyDuel allyToDuel) { bool has = listOfAllyToDuel.Any(tempAlly => tempAlly == allyToDuel); if (has == false) { return; } listOfAllyToDuel.Remove(allyToDuel); }
void GetCurrentTarget() { List <AllyDuel> listOfTargets = listOfAllyToDuel.Where(tempAlly => tempAlly.duelData.canAttack == true).ToList(); if (listOfTargets.Count == 0) { currentTarget = null; return; } currentTarget = listOfTargets[0]; }
public void ArrangeDuel(AllyDuel allyToDuel) { bool has = listOfAllyToDuel.Any(tempAlly => tempAlly == allyToDuel); if (has) { return; } listOfAllyToDuel.Add(allyToDuel); }
void Start() { heroToSpawn = Main.instance.score.playerData.currentHero; var heroList = FindObjectOfType <HeroList>().heroList; foreach (GameObject tempGO in heroList) { Hero.HeroID tempId = tempGO.GetComponent <Hero>().heroID; if (tempId == heroToSpawn) { AllyDuel allyScript = Instantiate <GameObject>(tempGO).GetComponent <AllyDuel>(); allyScript.transform.position = transform.position; allyScript.SetAsReinforcementWarrior(transform.position); return; } } }
public bool IsOnDuelWithOtherThanMe(AllyDuel allyDuelToCheck) { bool has = listOfAllyToDuel.Any(tempAlly => tempAlly != allyDuelToCheck); return(has); }