示例#1
0
    public void LoadCard(Card c)
    {
        if (c == null)
        {
            return;
        }

        card = c;

        for (int i = 0; i < c.properties.Length; i++)
        {
            CardProperties cp = c.properties[i];

            CardVizProperties p = GetProperty(cp.element);
            if (p == null)
            {
                continue;
            }

            if (cp.element is ElementInt)
            {
                p.text.text = cp.intValue.ToString();
            }
            else
            if (cp.element is ElementText)
            {
                p.text.text = cp.stringValue;
            }
            else
            if (cp.element is ElementImage)
            {
                p.img.sprite = cp.sprite;
            }
        }
    }
示例#2
0
    public virtual void OnSetType(CardViz viz)
    {
        Element           t    = GameAssignment.GetResourcesManager().typeElement;
        CardVizProperties type = viz.GetProperty(t);

        type.text.text = typeName;
    }
示例#3
0
    // public TypeLogic logic;

    public virtual void OnSetType(CardViz viz)
    {
        Element           element = Settings.GetResourcesManager().typeElement;
        CardVizProperties type    = viz.GetProperty(element);

        type.text.text = typeName;
    }
示例#4
0
    public void LoadCard(Card c)
    {
        if (c == null)
        {
            return;
        }

        card = c;

        c.cardType.OnSetType(this);

        for (int i = 0; i < c.properties.Length; i++)
        {
            CardProperties    cp = c.properties[i];
            CardVizProperties p  = GetProperty(cp.element);

            if (p == null)
            {
                continue;
            }

            if (cp.element is ElementInt)
            {
                p.text.text = cp.intValue.ToString();
            }
            else if (cp.element is ElementText)
            {
                p.text.text = cp.stringValue;
            }
            else if (cp.element is ElementImage)
            {
                p.image.sprite = cp.sprite;
            }
        }

        /*title.text = c.cardName;
         * if (string.IsNullOrEmpty(c.cardText))
         * {
         *  cardText.gameObject.SetActive(false);
         * }
         * else
         * {
         *  cardText.gameObject.SetActive(true);
         *  cardText.text = c.cardText;
         * }
         *
         * art.sprite = c.art;
         * cardOil.text = c.cardOil.ToString();
         * cardHearts.text = c.cardHearts.ToString();
         * cardHE.text = c.cardHE.ToString();
         * cardPierce.text = c.cardPierce.ToString();
         */
    }
示例#5
0
    public CardVizProperties GetProperty(Element e)
    {
        CardVizProperties result = null;

        for (int i = 0; i < properties.Length; i++)
        {
            if (properties[i].element == e)
            {
                result = properties[i];
                break;
            }
        }
        return(result);
    }
示例#6
0
    public void LoadCard(Card card)
    {
        if (card == null)
        {
            return;
        }

        this.card = card;

        card.cardType.OnSetType(this);

        CloseAll();

        for (int i = 0; i < card.properties.Length; i++)
        {
            CardProperties cardProperties = card.properties[i];

            CardVizProperties cardVizProperties = GetProperty(cardProperties.element);

            if (cardVizProperties == null)
            {
                continue;
            }

            if (cardProperties.element is ElementInt)
            {
                cardVizProperties.text.text = cardProperties.integerValue.ToString();
                cardVizProperties.text.gameObject.SetActive(true);
            }
            else if (cardProperties.element is ElementText)
            {
                cardVizProperties.text.text = cardProperties.stringValue;
                cardVizProperties.text.gameObject.SetActive(true);
            }
            else if (cardProperties.element is ElementImage)
            {
                cardVizProperties.img.sprite = cardProperties.sprite;
                cardVizProperties.img.gameObject.SetActive(true);
            }
        }
    }
示例#7
0
    public void LoadCard(Card c)
    {
        if (c == null)
        {
            return;
        }

        card = c;
        c.cardType.OnSetType(this);
        CloseAll();

        for (int i = 0; i < c.properties.Length; i++)
        {
            CardProperties    cp = c.properties[i];
            CardVizProperties p  = GetProperty(cp.element);
            if (p == null)
            {
                continue;
            }

            if (cp.element is ElementText)
            {
                p.text.text = cp.stringVal;
                p.text.gameObject.SetActive(true);
            }

            if (cp.element is ElementImage)
            {
                p.img.sprite = cp.sprite;
                p.img.gameObject.SetActive(true);
            }

            if (cp.element is ElementInt)
            {
                p.text.text = cp.intVal.ToString();
                p.text.gameObject.SetActive(true);
            }
        }
    }