public static void CreatePanelConfgText()
        {
            string path = EditorDialogUtility.OpenFileDialog("GetUIPanelConfigure", "", "");

            Debug.Log("SourcePath  ... " + path);
            path = path.Substring(path.IndexOf("Assets"));
            Debug.Log("RelativePath   ... " + path.Substring(path.IndexOf("Assets")));

            UIPanelConfigure bullet = AssetDatabase.LoadAssetAtPath <UIPanelConfigure>(path);
            string           msg    = JsonParser.Serialize(bullet.AllUIPanelConfigure);

            Debug.Log(msg);

            //string savePath = EditorDialogUtility.SaveFileDialog("保存Json文本", "", "UIPanelConfg", "txt");
            //Debug.Log("CreatePanelConfgText >>savePath= " + savePath);
            //if (File.Exists(savePath) == false)
            //    File.Create(savePath);
            //File.WriteAllText(savePath, msg);
            File.WriteAllText(Application.dataPath + "/" + ConstDefine.UIPanelConfigure + ".txt", msg);

            AssetDatabase.Refresh();
        }
예제 #2
0
        public static void CreateSceneItemConfg_Json()
        {
            string path = EditorDialogUtility.OpenFileDialog("Get AllSceneGeneration Items Confg Asset", "", "");

            Debug.Log("SourcePath  ... " + path);
            path = path.Substring(path.IndexOf("Assets"));
            Debug.Log("RelativePath   ... " + path.Substring(path.IndexOf("Assets")));

            SceneItemGenarationInfor_Total bullet = AssetDatabase.LoadAssetAtPath <SceneItemGenarationInfor_Total>(path);

            Debug.Log(bullet);
            string msg = JsonParser.Serialize(bullet.TotalConfgForAllScene);

            Debug.Log(msg);

            //string savePath = EditorDialogUtility.SaveFileDialog("±£´æJsonÎı¾", "", "UIPanelConfg", "txt");
            //Debug.Log("CreatePanelConfgText >>savePath= " + savePath);
            //if (File.Exists(savePath) == false)
            //    File.Create(savePath);
            //File.WriteAllText(savePath, msg);
            File.WriteAllText(Application.dataPath + "/" + ConstDefine.SceneDynamicConfigure + ".txt", msg);

            AssetDatabase.Refresh();
        }