示例#1
0
        //public typeslogic

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

            type.text.text = typeName;
        }
示例#2
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);
        }
示例#3
0
        public void LoadCard(Card c)
        {
            if (c == null)
            {
                return;
            }
            card = c;
            card.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 ElementInteger)
                {
                    p.text.text = cp.intValue.ToString();
                    p.text.gameObject.SetActive(true);
                }
                if (cp.element is ElementText)
                {
                    p.text.text = cp.stringValue;
                    p.text.gameObject.SetActive(true);
                }
                else
                if (cp.element is ElementImage)
                {
                    p.img.sprite = cp.sprite;
                    p.img.gameObject.SetActive(true);
                }
            }
        }