Exemplo n.º 1
0
 void LoadDeck(string deckName)
 {
     Dictionary <int, int>[] loadedDeck = DeckRW.loadDeck(deckName);
     foreach (int index in loadedDeck[0].Keys)
     {
         if (index != -1)
         {
             if (loadedDeck[0][index] == 0)
             {
                 Debug.LogError("Saved count 0");
             }
             //Debug.Log(loadedDeck[0][index]);
             addCard(index, deckCards.main[index].GetComponent <Cardmaker>(), deckType.main, loadedDeck[0][index]);
         }
     }
     if (loadedDeck.Length > 1)
     {
         foreach (int index in loadedDeck[1].Keys)
         {
             if (index != -1)
             {
                 //Debug.Log(index);
                 if (loadedDeck[1][index] == 0)
                 {
                     Debug.LogError("Saved count 0");
                 }
                 addCard(index, deckCards.structures[index].GetComponent <Cardmaker>(), deckType.structure, loadedDeck[1][index]);
             }
         }
     }
 }
Exemplo n.º 2
0
    public void exportDeck()
    {
        if (currentEditingDeck == "")
        {
            return;
        }
        GameObject exp;

        exp = GameObject.FindGameObjectWithTag("DeckExport");
        if (!exp)
        {
            exp = Instantiate(deckExportPre);
        }
        exp.GetComponent <DeckExport>().holdDeck(DeckRW.loadDeck(currentEditingDeck));
    }