PackageExportManger(Unity自动导出Package)

Package导出,直接放到了项目目录下,和Assets同级,导出完成会自动打开文件夹

/*******************************************************************************
* 版本声明:v1.0.0
* 类 名 称:PackageExportManger
* 创建日期:2020-05-25 13:59:44
* 作者名称:末零
* 功能描述:Package导出
* 修改记录:
* 
******************************************************************************/

using System;

using UnityEditor;
using UnityEngine;

namespace LastZero
{
    /// 
    /// Package导出
    /// 
    public class PackageExportManger
    {
        /// 
        /// 导出 Alt+E
        /// 
        [MenuItem("EditorTools/Export &E")]
        static void Export()
        {
            string assetPath = "Assets/LastZeroFrame";//框架路径
            string packageName = "LastZeroFrame_" + DateTime.Now.ToString("yyyyMMddHHmm") + ".unitypackage";//生成包名
            GUIUtility.systemCopyBuffer = packageName;//将包名复制到剪切板
            AssetDatabase.ExportPackage(assetPath, packageName, ExportPackageOptions.Recurse);
            Application.OpenURL(System.IO.Directory.GetParent(Application.dataPath).ToString());
        }
    }
}

 

你可能感兴趣的:(Unity,Tools,ExportPackage)