Exemplo n.º 1
0
    void createPlayableCards()
    {
        string[] decksMade = DeckRW.getDecks();
        for (int i = 0; i < decksMade.Length; i++)
        {
            GameObject d   = Instantiate(deckPre, decksMadeList.transform);
            DeckUI     dui = d.GetComponent <DeckUI>();
            dui.assignName(decksMade[i], this);
        }

        //foreach(GameObject c in deckCards.main)
        for (int i = 0; i < deckCards.main.Count; i++)
        {
            GameObject c    = deckCards.main[i];
            Cardmaker  mkr  = c.GetComponent <Cardmaker>();
            GameObject card = Instantiate(buildCardPre, mainCardList.transform);
            card.GetComponent <BuildCard>().initalize(mkr, i, this, deckType.main);
        }

        for (int i = 0; i < deckCards.structures.Count; i++)
        {
            GameObject c    = deckCards.structures[i];
            Cardmaker  mkr  = c.GetComponent <Cardmaker>();
            GameObject card = Instantiate(buildCardPre, strcCardList.transform);
            card.GetComponent <BuildCard>().initalize(mkr, i, this, deckType.structure);
        }

        mainCardScroll.GetComponent <ScrollRect>().verticalNormalizedPosition  = 1;
        strcCardScroll.GetComponent <ScrollRect>().verticalNormalizedPosition  = 1;
        decksMadeScroll.GetComponent <ScrollRect>().verticalNormalizedPosition = 1;
    }
Exemplo n.º 2
0
    public void leaveDeck()
    {
        if (SaveDeck(currentEditingDeck))
        {
            //create deck
            GameObject d   = Instantiate(deckPre, decksMadeList.transform);
            DeckUI     dui = d.GetComponent <DeckUI>();
            dui.assignName(currentEditingDeck, this);
        }

        resetDeckCounters();
        currentEditingDeck = "";
        if (currentDeckUI)
        {
            currentDeckUI.deselect();
        }
        swapMode(deckType.deck);
    }