예제 #1
0
        private string GetLocalPlanVersion(int planId)
        {
            //[{"boxId":1, "boxVersion":"123"}, {"boxId":2, "boxVersion":"234"}]
            ContentModel      localModel  = PlayerPrefsUtil.GetLocalContentModel(planId);
            string            json        = "";
            List <BoxVersion> boxVersions = new List <BoxVersion>();

            if (localModel.IsNotNull())
            {
                foreach (var boxModel in localModel.boxList)
                {
                    BoxVersion box = new BoxVersion();
                    box.boxId      = boxModel.boxId;
                    box.boxVersion = boxModel.boxVersion;
                    boxVersions.Add(box);
                }
            }

            if (boxVersions.Count > 0)
            {
                json = JsonConvert.SerializeObject(boxVersions, Formatting.None);
            }
            return(json);
        }