Example #1
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 "pos":
                pos = MyJsonTool.getVector2(dic, key);
                break;

            default:
                break;
            }
        }
    }
    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;
            }
        }
    }
    public void DeSerialize(Dictionary <string, object> dic)
    {
        materialData = new MaterialData();
        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 "isT":
                isT = MyJsonTool.getBoolValue(dic, key);
                break;

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

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

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

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

            case "materialData":
            {
                object obj = MyJsonTool.getValue(dic, key);
                materialData.DeSerialize(obj as Dictionary <string, object>);
            }
            break;

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

            default:
                break;
            }
        }
    }
    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 "width":
                width = MyJsonTool.getFloatValue(dic, key);
                break;;

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

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

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

            case "point1To2Data":
            {
                object obj = MyJsonTool.getValue(dic, key);
                point1To2Data.DeSerialize(obj as Dictionary <string, object>);
            }
            break;;

            case "point2To1Data":
            {
                object obj = MyJsonTool.getValue(dic, key);
                point2To1Data.DeSerialize(obj as Dictionary <string, object>);
            }
            break;

            default:
                break;
            }
        }
    }
Example #5
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;
            }
        }
    }
Example #6
0
    public void DeSerialize(Dictionary <string, object> dic)
    {
        materialData = new MaterialData();
        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 "forward":
                forward = MyJsonTool.getBoolValue(dic, key);
                break;

            case "materialData":
            {
                object obj = MyJsonTool.getValue(dic, key);
                materialData.DeSerialize(obj as Dictionary <string, object>);
            }
            break;

            case "tBaseboard":
            {
                object obj = MyJsonTool.getValue(dic, key);
                tBaseboard.DeSerialize(obj as Dictionary <string, object>);
            }
            break;

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

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

            case "priceList":
            {
                object obj = MyJsonTool.getValue(dic, key);
                if (obj == null)
                {
                    priceList = null;
                    break;
                }
                priceList = new List <ItemData>();
                List <object> arr = obj as List <object>;
                for (int i = 0; i < arr.Count; i++)
                {
                    ItemPrice data = new ItemPrice();
                    data.Deserialize(arr[i] as Dictionary <string, object>);
                    priceList.Add(data);
                }
            }
            break;

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

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

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

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

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

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

            default:
                break;
            }
        }
    }
    public void DeSerialize(Dictionary <string, object> dic)
    {
        if (dic == null)
        {
            Debug.LogWarning("RoomData DeSerialize(dic == null)");
            return;
        }
        sideListGuids  = new List <int>();
        pointListGuids = new List <int>();
        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 "name":
                name = MyJsonTool.getStringValue(dic, key);
                break;

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

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

            case "ceiling":
            {
                object obj = MyJsonTool.getValue(dic, key);
                ceiling.DeSerialize(obj as Dictionary <string, object>);
            }
            break;

            case "floor":
            {
                object obj = MyJsonTool.getValue(dic, key);
                floor.DeSerialize(obj as Dictionary <string, object>);
            }
            break;

            case "sideListGuids":
            {
                object obj = MyJsonTool.getValue(dic, key);
                if (obj == null)
                {
                    break;
                }
                List <object> list = obj as List <object>;
                for (int i = 0; i < list.Count; i++)
                {
                    int Guid = int.Parse(list[i].ToString());
                    sideListGuids.Add(Guid);
                }
            }
            break;

            case "pointListGuids":
            {
                object obj = MyJsonTool.getValue(dic, key);
                if (obj == null)
                {
                    break;
                }
                List <object> list = obj as List <object>;
                for (int i = 0; i < list.Count; i++)
                {
                    int Guid = int.Parse(list[i].ToString());
                    pointListGuids.Add(Guid);
                }
            }
            break;

            default:
                break;
            }
        }
    }
Example #9
0
    public void DeSerialize(Dictionary <string, object> dic)
    {
        foreach (string key in dic.Keys)
        {
            switch (key)
            {
            case "DefaultUnit":
            {
                string value = MyJsonTool.getStringValue(dic, key);
                switch (value)
                {
                case "m":
                    DefaultUnit = Unit.m;
                    break;

                case "dm":
                    DefaultUnit = Unit.dm;
                    break;

                case "cm":
                    DefaultUnit = Unit.cm;
                    break;

                case "mm":
                    DefaultUnit = Unit.mm;
                    break;

                case "ft":
                    DefaultUnit = Unit.ft;
                    break;

                default:
                    break;
                }
            }
            break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            default:
                break;
            }
        }
    }
    public void DeSerialize(Dictionary <string, object> dic)
    {
        if (dic == null)
        {
            Debug.LogError("OriginalProjectData dic.DeSerialize(dic), dic = null");
            return;
        }
        data    = new OriginalInputData();
        version = new MyTimeData();
        foreach (string key in dic.Keys)
        {
            switch (key)
            {
            case "id":
                id = MyJsonTool.getStringValue(dic, key);
                break;

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

            case "data":
            {
                object obj = MyJsonTool.getValue(dic, key);
                data.isOld = false;
                if (dic.ContainsKey("version") == false)
                {
                    data.isOld = true;
                }
                data.DeSerialize(obj as Dictionary <string, object>);
            }
            break;

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

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

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

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

            case "idNew":
                isNew = MyJsonTool.getBoolValue(dic, key);
                //isNew = false;
                break;

            case "version":
            {
                object obj = MyJsonTool.getValue(dic, key);
                version.DeSerialize(obj as Dictionary <string, object>);
                //isNew = false;
            }
            break;

            default:
                break;
            }
        }
    }
Example #11
0
    public void DeSerialize(Dictionary <string, object> dic)
    {
        if (dic == null)
        {
            return;
        }
        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 "stringId":
                stringId = MyJsonTool.getStringValue(dic, key);
                break;

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

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

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

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

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

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

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

            case "offsetY":
                offsetY = MyJsonTool.getFloatValue(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;
            }
        }
    }