Example #1
0
    public void updateChipImage(ChipVO vo)
    {
        Chip.SetActive(true);
        Full.SetActive(false);

        //TODO:后续统一从资源管理器脚本类加载预设
        //品质外框
        string frame       = ChipQualityPath(vo.Quality);
        string qualitypath = "ChangeIcon/ImageIcon/qualityframe/" + frame;

        ChipFrame.overrideSprite = Resources.Load(qualitypath, typeof(Sprite)) as Sprite;

        //碎片图标
        string kindpath = "ChangeIcon/ImageIcon/chip/fragment_tag";

        chipKind.overrideSprite = Resources.Load(kindpath, typeof(Sprite)) as Sprite;

        //装备或卷轴图标
        string cardpath = string.Empty;

        if (vo.Type == 1)           //type为1则是装备碎片
        {
            cardpath = "ChangeIcon/ImageIcon/equip/";
        }
        else if (vo.Type == 2)        //type为2则是卷轴碎片
        {
            cardpath = "ChangeIcon/ImageIcon/scroll/";
        }
        else
        {
            Debug.LogWarning("there is sth wrong with chip type");
            return;
        }
        cardpath += vo.ID.ToString() + "+";

        chipCardIcon.overrideSprite = Resources.Load(cardpath, typeof(Sprite)) as Sprite;
    }
Example #2
0
    private void Convert()
    {
        //todo:暂时写法,后续会对数据读取解析进行不断优化
        switch (mVO.goodsType)
        {
        case GoodsType.Equipment:
            var evo = new EquipmentVO();
            evo.id          = mVO.id;
            evo.own         = mVO.own;
            evo.price       = mVO.totalcost;
            evo.quality     = mVO.quality;
            evo.name        = mVO.name;
            evo.detail      = mVO.description;
            evo.extradetail = mVO.extraDescription;
            goodsCard.updateEquipImage(evo);
            break;

        case GoodsType.Medicine:
            var mvo = new MedicineVO();
            mvo.id          = mVO.id;
            mvo.own         = mVO.own;
            mvo.price       = mVO.totalcost;
            mvo.quality     = mVO.quality;
            mvo.name        = mVO.name;
            mvo.detail      = mVO.description;
            mvo.extradetail = mVO.extraDescription;
            goodsCard.updateMedicineImage(mvo);
            break;

        case GoodsType.Scroll:
            var svo = new ScrollVO();
            svo.id          = mVO.id;
            svo.own         = mVO.own;
            svo.price       = mVO.totalcost;
            svo.quality     = mVO.quality;
            svo.name        = mVO.name;
            svo.detail      = mVO.description;
            svo.extradetail = mVO.extraDescription;
            goodsCard.updateScrollImage(svo);
            break;

        case GoodsType.SoulStone:
            var ssvo = new SoulStoneVO();
            ssvo.id          = mVO.id;
            ssvo.own         = mVO.own;
            ssvo.price       = mVO.totalcost;
            ssvo.quality     = mVO.quality;
            ssvo.name        = mVO.name;
            ssvo.detail      = mVO.description;
            ssvo.extradetail = mVO.extraDescription;
            goodsCard.updateSoulStoneImage(ssvo);
            break;

        case GoodsType.Chip:
            var cvo = new ChipVO();
            cvo.type        = mVO.chiptype;
            cvo.id          = mVO.id;
            cvo.own         = mVO.own;
            cvo.price       = mVO.totalcost;
            cvo.quality     = mVO.quality;
            cvo.name        = mVO.name;
            cvo.detail      = mVO.description;
            cvo.extradetail = mVO.extraDescription;
            goodsCard.updateChipImage(cvo);
            break;
        }
    }
Example #3
0
    private void Convert()
    {
        GoodsItemVO mVO = currSelectedVO;
        //todo:暂时写法,后续会对数据读取解析进行不断优化
        switch (mVO.goodsType)
        {
            case GoodsType.Equipment:
                var evo = new EquipmentVO();
                evo.id = mVO.id;
                evo.own = mVO.own;
                evo.price = mVO.totalcost;
                evo.quality = mVO.quality;
                evo.name = mVO.name;
                evo.detail = mVO.description;
                evo.extradetail = mVO.extraDescription;
                goodsCard.updateEquipImage(evo);
                break;

            case GoodsType.Medicine:
                var mvo = new MedicineVO();
                mvo.id = mVO.id;
                mvo.own = mVO.own;
                mvo.price = mVO.totalcost;
                mvo.quality = mVO.quality;
                mvo.name = mVO.name;
                mvo.detail = mVO.description;
                mvo.extradetail = mVO.extraDescription;
                goodsCard.updateMedicineImage(mvo);
                break;

            case GoodsType.Scroll:
                var svo = new ScrollVO();
                svo.id = mVO.id;
                svo.own = mVO.own;
                svo.price = mVO.totalcost;
                svo.quality = mVO.quality;
                svo.name = mVO.name;
                svo.detail = mVO.description;
                svo.extradetail = mVO.extraDescription;
                goodsCard.updateScrollImage(svo);
                break;

            case GoodsType.SoulStone:
                var ssvo = new SoulStoneVO();
                ssvo.id = mVO.id;
                ssvo.own = mVO.own;
                ssvo.price = mVO.totalcost;
                ssvo.quality = mVO.quality;
                ssvo.name = mVO.name;
                ssvo.detail = mVO.description;
                ssvo.extradetail = mVO.extraDescription;
                goodsCard.updateSoulStoneImage(ssvo);
                break;

            case GoodsType.Chip:
                var cvo = new ChipVO();
                cvo.type = mVO.chiptype;
                cvo.id = mVO.id;
                cvo.own = mVO.own;
                cvo.price = mVO.totalcost;
                cvo.quality = mVO.quality;
                cvo.name = mVO.name;
                cvo.detail = mVO.description;
                cvo.extradetail = mVO.extraDescription;
                goodsCard.updateChipImage(cvo);
                break;
        }
    }
Example #4
0
    public void updateChipImage(ChipVO vo)
    {
        Chip.SetActive(true);
        Full.SetActive(false);

        //TODO:后续统一从资源管理器脚本类加载预设
        //品质外框
        string frame = ChipQualityPath(vo.Quality);
        string qualitypath = "ChangeIcon/ImageIcon/qualityframe/" + frame;
        ChipFrame.overrideSprite = Resources.Load(qualitypath, typeof(Sprite)) as Sprite;

        //碎片图标
        string kindpath = "ChangeIcon/ImageIcon/chip/fragment_tag";
        chipKind.overrideSprite = Resources.Load(kindpath, typeof(Sprite)) as Sprite;

        //装备或卷轴图标
        string cardpath = string.Empty;
        if (vo.Type == 1)           //type为1则是装备碎片
        {
            cardpath = "ChangeIcon/ImageIcon/equip/";
        }
        else if(vo.Type ==2)        //type为2则是卷轴碎片
        {
            cardpath = "ChangeIcon/ImageIcon/scroll/";
        }
        else
        {
            Debug.LogWarning("there is sth wrong with chip type");
            return;
        }
        cardpath += vo.ID.ToString() + "+";
        
        chipCardIcon.overrideSprite = Resources.Load(cardpath, typeof(Sprite)) as Sprite;
    }