Example #1
0
    private static void OpenExportFolder()
    {
        if (!ExportUtil.CreateExportFolder())
        {
            return;
        }

        OpenFolder();
    }
Example #2
0
    private static bool Export(Func <int> logicFun)
    {
        if (!ExportUtil.CreateExportFolder())
        {
            return(false);
        }

        Transform[] selectedTrans = Selection.GetTransforms(SelectionMode.Editable | SelectionMode.ExcludePrefab);
        if (selectedTrans.Length == 0)
        {
            EditorUtility.DisplayDialog("未选中模型", "请选中一个或多个模型", "关闭");
            return(false);
        }

        int index = 0;

        if (logicFun != null)
        {
            index = logicFun();
        }

        if (index > 0)
        {
            if (EditorUtility.DisplayDialog("导出成功", "成功导出" + index + "个模型", "打开导出目录", "关闭"))
            {
                OpenFolder();
            }

            return(true);
        }
        else
        {
            EditorUtility.DisplayDialog("错误", "导出失败", "关闭");
            return(false);
        }
    }