public void DeSerialize(Dictionary <string, object> dic)
    {
        foreach (string key in dic.Keys)
        {
            switch (key)
            {
            case "id":
                id = MyJsonTool.getIntValue(dic, key);
                break;

            case "position":
                position = MyJsonTool.getVector3(dic, key);
                break;

            case "rotate":
                rotate = MyJsonTool.getVector3(dic, key);
                break;

            case "imagemeta":
                imagemeta = MyJsonTool.getStringValue(dic, key);
                break;

            case "follow":
                follow = MyJsonTool.getBoolValue(dic, key);
                break;

            case "focaseP":
                focaseP = MyJsonTool.getVector3(dic, key);
                break;

            default:
                break;
            }
        }
    }
Exemple #2
0
    public void DeSerialize(Dictionary <string, object> dic)
    {
        foreach (string key in dic.Keys)
        {
            switch (key)
            {
            case "guid":
                guid = MyJsonTool.getIntValue(dic, key);
                break;

            case "id":
                id = MyJsonTool.getIntValue(dic, key);
                break;

            case "hide":
                hide = MyJsonTool.getBoolValue(dic, key);
                break;

            case "targetWallGuid":
                targetWallGuid = MyJsonTool.getIntValue(dic, key);
                break;

            case "seekId":
                seekId = MyJsonTool.getStringValue(dic, key);
                break;

            case "position":
                position = MyJsonTool.getVector3(dic, key);
                break;

            case "scale":
                scale = MyJsonTool.getVector3(dic, key);
                break;

            case "rotate":
                rotate = MyJsonTool.getFloatValue(dic, key);
                break;

            case "height":
                height = MyJsonTool.getFloatValue(dic, key);
                break;

            case "type":
                type = MyJsonTool.getIntValue(dic, key);
                break;

            default:
                break;
            }
        }
    }
    public void DeSerialize(Dictionary <string, object> dic)
    {
        foreach (string key in dic.Keys)
        {
            switch (key)
            {
            case "id":
                id = MyJsonTool.getStringValue(dic, key);
                break;

            case "size":
                size = MyJsonTool.getVector3(dic, key);
                break;

            case "defaultHeight":
                defaultHeight = MyJsonTool.getFloatValue(dic, key);
                break;

            case "seekId":
                seekId = MyJsonTool.getStringValue(dic, key);
                break;

            case "name":
                name = MyJsonTool.getStringValue(dic, key);
                break;

            case "unit":
                unit = MyJsonTool.getStringValue(dic, key);
                break;

            case "productType":
                productType = MyJsonTool.getStringValue(dic, key);
                break;

            case "contentType":
                contentType = MyJsonTool.getStringValue(dic, key);
                break;

            case "entityType":
                entityType = MyJsonTool.getStringValue(dic, key);
                break;

            case "thumbnail":
                thumbnail = MyJsonTool.getStringValue(dic, key);
                break;

            case "images":
                images = MyJsonTool.getStringListValue(dic, key);
                break;

            case "imagesResize":
                imagesResize = MyJsonTool.getStringListValue(dic, key);
                break;

            case "categories":
                categories = MyJsonTool.getStringListValue(dic, key);
                break;

            case "families":
                families = MyJsonTool.getStringListValue(dic, key);
                break;

            case "v":
                v = MyJsonTool.getStringValue(dic, key);
                break;

            case "vu":
                vu = MyJsonTool.getStringValue(dic, key);
                break;

            case "productURL":
                productURL = MyJsonTool.getStringValue(dic, key);
                break;

            case "status":
                status = MyJsonTool.getIntValue(dic, key);
                break;

            case "modelTexture":
                modelTexture = MyJsonTool.getStringValue(dic, key);
                break;

            case "model3d":
            {
                //阿里云
                string path = MyJsonTool.getStringValue(dic, key);
                //alluserdata/youke001/Assetbundle/03e68276-b2f4-4a2a-ac71-c86b8690b618/model.assetbundle(Clone)
                //"http://hsm-prod-assets.s3.amazonaws.com/i/4abd1bba-6d61-481e-9008-25295599e006/model.gz.bobj"
                path = path.Replace("-fc.gz", ".assetbundle");
                path = path.Replace("midea-prod-assets.s3.cn-north-1.amazonaws.com.cn/i/", "midea-products.oss-cn-shanghai.aliyuncs.com/");

                path = path.Replace(".gz.bobj", ".assetbundle");
                path = path.Replace("hsm-prod-assets.s3.amazonaws.com/i/", "midea-products.oss-cn-shanghai.aliyuncs.com/");
                //path = path.Replace("hsm-prod-assets.s3.amazonaws.com/i/", "pms.3dshome.net/");

                model3d = path;
            }
            break;

            case "top":
            {
                //亚马逊
                string path = MyJsonTool.getStringValue(dic, key);
                //path = path.Replace("midea-products.oss-cn-shanghai.aliyuncs.com/", "pms.3dshome.net/");
                this.top = path;
            }
            break;

            case "variations":
                variations = MyJsonTool.getStringListValue(dic, key);
                break;

            case "variationId":
                variationId = MyJsonTool.getStringValue(dic, key);
                break;

            case "isScalable":
                isScalable = MyJsonTool.getBoolValue(dic, key);
                break;

            case "components":
                components = MyJsonTool.getStringListValue(dic, key);
                break;

            case "retailers":
                //retailers = MyJsonTool.getStringListValue(dic, key);
                break;

            case "modifiedTime":
                //modifiedTime = MyJsonTool.getStringListValue(dic, key);
                break;

            case "ticket":
                //ticket = MyJsonTool.getStringListValue(dic, key);
                break;

            case "groups":
                //groups = MyJsonTool.getStringListValue(dic, key);
                break;

            case "zIndex":
                //zIndex = MyJsonTool.getStringListValue(dic, key);
                break;

            case "tileSize":
                //tileSize = MyJsonTool.getStringListValue(dic, key);
                break;

            case "attributes":
                //attributes = MyJsonTool.getStringListValue(dic, key);
                break;

            default:
                Debug.LogWarning("Product缺少字段:" + key);
                break;
            }
        }
    }