Пример #1
0
    void UpdateVue()
    {
        SceneHelper.DestroyChildrenInParent(cardParent);
        overlaytitle.text = title;

        for (int i = 0; i < cards.Length; i++)
        {
            AddCard(cards[i], i);
            AddButton(cards[i], i);
        }

        cardWrapper.sizeDelta = new Vector2(0f, ContentHeight(cards.Length));
    }
Пример #2
0
    void UpdateVue()
    {
        SceneHelper.DestroyChildrenInParent(cardParent);

        for (int i = 0; i < cardIndexes.Length; i++)
        {
            CardData card = deck.GetCard(cardIndexes[i]);
            AddCard(card, i);
            AddButton(card.Title, cardIndexes[i], i);
        }

        cardWrapper.sizeDelta = new Vector2(cardIndexes.Length * (cardObjectWidth + padding) + padding, 400);
    }
Пример #3
0
    void UpdateVue()
    {
        SceneHelper.DestroyChildrenInParent(cardParent);
        deckTitle.text = deck.Title;

        CardData[] cards = deck.GetCardsSorted();

        for (int i = 0; i < cards.Length; i++)
        {
            AddCard(cards[i], i, cards.Length);
        }

        cardWrapper.sizeDelta = new Vector2(0f, ContentHeight(cards.Length));
    }
Пример #4
0
    public void DisplayCards(CardData[] cards, int[] indexes)
    {
        SceneHelper.DestroyChildrenInParent(parent);
        for (int i = 0; i < cards.Length; i++)
        {
            GameObject card   = Instantiate(cardPrefab);
            CardUI     script = card.GetComponent <CardUI>();
            script.Data             = cards[i];
            card.transform.position = new Vector3(i * (cardWidth + padding), 0f, 0f);
            card.transform.SetParent(parent, false);
        }

        parent.sizeDelta = new Vector2((cardWidth + padding) * cards.Length - padding, cardHeight);
    }
Пример #5
0
 public void DisplayCard(CardData data)
 {
     if (data == null)
     {
         SceneHelper.DestroyChildrenInParent(parent);
     }
     else
     {
         SceneHelper.DestroyChildrenInParent(parent);
         GameObject card   = Instantiate(cardPrefab);
         CardUI     script = card.GetComponent <CardUI>();
         script.Data = data;
         card.transform.SetParent(parent, false);
     }
 }
Пример #6
0
    void UpdateVue()
    {
        SceneHelper.DestroyChildrenInParent(mainKeywordParent);
        SceneHelper.DestroyChildrenInParent(associatedKeywordParent);

        SetCard(mainCard, cardData, mainKeywordParent);

        if (cardData.AssociatedCard == null)
        {
            associatedCard.gameObject.SetActive(false);
        }
        else
        {
            SetCard(associatedCard, cardData.AssociatedCard, associatedKeywordParent);
            associatedCard.gameObject.SetActive(true);
        }
    }
Пример #7
0
 public void Clear()
 {
     SceneHelper.DestroyChildrenInParent(parent);
 }