public void definirFactionAleatoire() { faction = DataManager.dataManager.getRandomFaction (); while (Colonie.instance.factionEstPresente (faction)) { faction = DataManager.dataManager.getRandomFaction (); } }
public bool factionEstPresente(Faction faction) { bool estPresent = false; foreach (Conseiller c in conseillers.Values) { if (c.faction.Equals (faction)) { estPresent = true; } } return estPresent; }
public void loadFactions() { XmlDocument doc = new XmlDocument (); doc.Load (dataPath + "/Factions.xml"); XmlNodeList nodes = doc.DocumentElement.ChildNodes; foreach (XmlNode node in nodes) { Faction f = new Faction(); f.nom = node.SelectSingleNode ("Nom").InnerText; f.sprite = Resources.Load<Sprite>("SPRITE/Personnages/" + node.SelectSingleNode ("Sprite").InnerText); // SpriteRenderer spriteRenderer = gameObject.AddComponent<SpriteRenderer>(); // spriteRenderer.sprite = Resources.Load<UnityEngine.Sprite>("Textures/Interface/button"); listeFactions.Add(f); } }
public AIBaseBuilding(int x,int y,Faction ai) : base(x,y) { faction = ai; activates.Add("MakeUnit"); }