Skip to content

Commit 1b6cfa8

Browse files
committed
fix: update package export api
1 parent f7fe38f commit 1b6cfa8

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

.github/workflows/release-template.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ jobs:
139139
key: Library-StandaloneLinux64
140140
restore-keys: Library-
141141

142-
- name: 📂 List files before export
143-
run: |
144-
echo "Listing files before export"
145-
ls -R
146-
147142
- name: 📦 Export Unity Package
148143
uses: game-ci/unity-builder@v4
149144
with:

Assets/Scripts/Editor/PackageExporter.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ public static class PackageExporter
88
public static void ExportPackage()
99
{
1010
string packageName = "com.mygamedevtools.scene-loader";
11+
string exportPath = Path.Combine(Application.dataPath, packageName + ".unitypackage");
1112

12-
string rootGuid = AssetDatabase.AssetPathToGUID("Packages/" + packageName);
13-
14-
string[] collection = Array.Empty<string>();
15-
collection = AssetDatabase.CollectAllChildren(rootGuid, collection);
16-
17-
PackageUtility.ExportPackage(collection, Path.Combine(Application.dataPath, packageName + ".unitypackage"));
18-
Console.WriteLine($"Exported package to: \"{Application.dataPath}/{packageName}.unitypackage\"");
13+
AssetDatabase.ExportPackage("Packages/" + packageName, exportPath, ExportPackageOptions.Recurse);
14+
Console.WriteLine($"Exported package to: \"{exportPath}\"");
1915
}
2016
}

0 commit comments

Comments
 (0)