Esempio n. 1
0
    public void DrawUI()
    {
        EditorGUILayout.Space();
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.TextField("", LocalSaveManager.GetString(outputSaveKey, "", false));
        if (GUILayout.Button("选择"))
        {
            string tempOutputPath = EditorUtility.OpenFolderPanel("选择导出目录", LocalSaveManager.GetString(outputSaveKey, "", false), "xlsx");
            LocalSaveManager.Save(outputSaveKey, tempOutputPath, false);
        }
        if (GUILayout.Button("导出数据"))
        {
            OutputExcel();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.Space();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.TextField("", LocalSaveManager.GetString(inputSaveKey, "", false));
        if (GUILayout.Button("选择"))
        {
            string tempOutputPath = EditorUtility.OpenFolderPanel("选择导入目录", LocalSaveManager.GetString(inputSaveKey, "", false), "");
            LocalSaveManager.Save(inputSaveKey, tempOutputPath, false);
        }
        if (GUILayout.Button("导入数据"))
        {
            InputExcel();
        }
        EditorGUILayout.EndHorizontal();
    }
    public void DrawUI()
    {
        EditorGUILayout.Space();

        if (GUILayout.Button("添加需要多语言功能的prefab文件夹"))
        {
            string path = EditorUtility.OpenFolderPanel("选择导出目录", Application.dataPath, "");
            pathList.Add(path);
            LocalSaveManager.Save(folderSaveKey, JsonMapper.ToJson(pathList), false);
        }

        EditorGUILayout.Space();
        EditorGUILayout.Space();

        for (int i = 0, count = pathList.Count; i < count; i++)
        {
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField(pathList[i]);
            if (GUILayout.Button("删除"))
            {
                removeName = pathList[i];
            }
            EditorGUILayout.EndHorizontal();
        }
        if (removeName != "")
        {
            pathList.Remove(removeName);
            LocalSaveManager.Save(folderSaveKey, JsonMapper.ToJson(pathList), false);
            removeName = "";
        }

        EditorGUILayout.Space();
        EditorGUILayout.Space();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.TextField("", LocalSaveManager.GetString(outputSaveKey, "", false));
        if (GUILayout.Button("选择"))
        {
            string tempOutputPath = EditorUtility.OpenFolderPanel("选择导出目录", LocalSaveManager.GetString(outputSaveKey, "", false), "xlsx");
            LocalSaveManager.Save(outputSaveKey, tempOutputPath, false);
        }
        if (GUILayout.Button("导出数据"))
        {
            OutputExcel();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.Space();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.TextField("", LocalSaveManager.GetString(inputSaveKey, "", false));
        if (GUILayout.Button("选择"))
        {
            string tempOutputPath = EditorUtility.OpenFolderPanel("选择导入目录", LocalSaveManager.GetString(inputSaveKey, "", false), "");
            LocalSaveManager.Save(inputSaveKey, tempOutputPath, false);
        }
        if (GUILayout.Button("导入数据"))
        {
            InputExcel();
        }
        EditorGUILayout.EndHorizontal();
    }