Esempio 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;
    }