private void GetDecksInfo(XmlNode levelInfo)
        {
            List <DeckInfo> decks = new List <DeckInfo>();

            foreach (XmlNode levelDeck in levelInfo.ChildNodes) //deck
            {
                int        id       = int.Parse(levelDeck.Attributes["key"].Value);
                List <int> decksIDs = new List <int>();
                DeckAsset  asset    = Resources.Load <DeckAsset>("DeckAssets/deck" + id);

                foreach (XmlNode levelCardID in levelDeck.ChildNodes)    //cardIDs
                {
                    decksIDs.Add(int.Parse(levelCardID.InnerText));
                }

                //Se añade el mazo a la lista
                decks.Add(new DeckInfo(id, decksIDs, asset));
            }

            GameManager.Instance.Decks = decks;
        }
Exemplo n.º 2
0
 public DeckInfo(DeckInfo other)
 {
     this.DeckID      = other.DeckID;
     this.DeckCardIDs = new List <int>(other.DeckCardIDs);
     this.DeckAsset   = other.DeckAsset;
 }
Exemplo n.º 3
0
 public DeckInfo(int id, List <int> cardsIDs, DeckAsset asset)
 {
     this.DeckID      = id;
     this.DeckCardIDs = cardsIDs;
     this.DeckAsset   = asset;
 }