Ejemplo n.º 1
0
    void OnGUI()
    {
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("配置路径", GUILayout.Width(100)))
        {
            string tempPath = EditorUtility.OpenFolderPanel("Xlsx 文件路径", "", "");
            if (!string.IsNullOrEmpty(tempPath))
            {
                xlsxPath = tempPath;
                EditorPrefs.SetString(XlsxPathKey, tempPath);
            }
        }

        GUILayout.Label(xlsxPath);
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("跳转路径", GUILayout.Width(100)))
        {
            System.Diagnostics.Process.Start(luaPath);
        }
        GUILayout.Label(luaPath);
        GUILayout.EndHorizontal();

        if (!string.IsNullOrEmpty(xlsxPath) && !string.IsNullOrEmpty(luaPath) && GUILayout.Button("生成"))
        {
            CreateManager tempManager = new CreateManager(xlsxPath);
            tempManager.GenerateLua_Client(luaPath);

            Debug.LogError("配置生成完毕");
        }
    }