Example #1
0
        public bool cardFilter(CardDefine cd, CardSkinData sd)
        {
            // 过滤费用
            if (filterCost != 0)
            {
                if (filterCost < 8)
                {
                    if (cd.getCost() != filterCost)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (cd.getCost() < 8)
                    {
                        return(false);
                    }
                }
            }

            // 过滤类型
            if (!string.IsNullOrEmpty(filterType))
            {
                if (!string.Equals(filterType, cd.type))
                {
                    return(false);
                }
            }

            // 过滤稀有度
            if (filterRare != 0)
            {
                // todo: 稀有度判断
            }

            // 过滤角色
            if (filterCharacter != 0)
            {
                // todo: 角色判断
            }

            // 过滤名字
            if (!string.IsNullOrEmpty(filterKeyword))
            {
                if (!sd.name.Contains(filterKeyword))
                {
                    return(false);
                }
            }


            return(true);
        }
Example #2
0
        public void update(CardDefine card, CardSkinData skin)
        {
            CostText.text   = card.getCost().ToString();
            AttackText.text = card.getAttack().ToString();
            LifeText.text   = card.getLife().ToString();

            Image.sprite       = skin.image;
            NameText.text      = skin.name;
            DescText.text      = skin.desc;
            IsFaceupController = IsFaceup.True;
        }