unity3d 代碼導出unity包


先選中Project面板中的文件或者文件夾,然後點擊菜單欄的Export/Exprot就開始導出


    [MenuItem("Exprot/Exprot")]
    static void Exprot() {
        Debug.LogWarning("開始");
        Object[] selectedAsset = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);
        List<string> list = new List<string>();
        for (int i = 0; i < selectedAsset.Length; i++) {
            list.Add(AssetDatabase.GetAssetPath(selectedAsset[i]));
        }

        ExportPackageOptions op = ExportPackageOptions.IncludeDependencies | ExportPackageOptions.Recurse;
        AssetDatabase.ExportPackage(list.ToArray(), "E:/xxxxx.unitypackage",op);
        Debug.LogWarning("結束");
    }


發佈了43 篇原創文章 · 獲贊 20 · 訪問量 29萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章