예제 #1
0
        void saveSceneDecoration()
        {
            SceneDecorationDic = SceneDecorationList.ToDictionary(item => item.id, item => item);

            string jsonString = Tools.Obj2Json(SceneDecorationDic, true);

            Debug.Log("jsonString = " + jsonString);
            Tools.WriteStringFromFile(Application.dataPath + "/" + SceneDecorationFile, jsonString);
            string scalejson = Tools.Obj2Json(imgsclae, true);

            Tools.WriteStringFromFile(Application.dataPath + "/Resources_moved/Scripts/SceneDecoration/scale.json", scalejson);

            // 生成预制体 add by TangJian 2017/11/16 17:42:05
            {
                foreach (var item in SceneDecorationDic)
                {
                    var itemObject = PrefabCreator.CreateSceneDecoration(item.Value, prefabPath, imgsclae);
                    Tools.UpdatePrefab(itemObject, prefabPath + "/" + item.Value.id + ".prefab");
                    DestroyImmediate(itemObject);
                }
            }
        }