Skip to content

Commit

Permalink
Update UnityPackageExporter.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
mackysoft committed Feb 21, 2022
1 parent 03a30c7 commit 9246d08
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Assets/PackageTools/Editor/UnityPackageExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace MackySoft.PackageTools.Editor {
public static class UnityPackageExporter {

// The name of the unitypackage to output.
const string k_PackageName = "UniVRM-UTS2Exporter";
const string k_PackageName = "UniVRM-UTS2Extensions";

// The path to the package under the `Assets/` folder.
const string k_PackagePath = "MackySoft";
Expand All @@ -19,13 +19,13 @@ public static class UnityPackageExporter {
const string k_SearchPattern = "*";
const string k_PackageToolsFolderName = "PackageTools";

[MenuItem("Tools/UniVRM-UTS2Exporter/Export Package")]
[MenuItem("Tools/UniVRM-UTS2Extensions/Export Package")]
public static void Export () {
ExportPackage($"{k_ExportPath}/{k_PackageName}.unitypackage");
ExportPackage($"{k_ExportPath}/{k_PackageName}.unitypackage",GetAssetPaths());
ExportPackage($"{k_ExportPath}/VRMShaderUpdate.unitypackage",GetVRMShaderUpdateAssetPaths());
}


public static string ExportPackage (string exportPath) {
public static string ExportPackage (string exportPath,string[] assetPaths) {
// Ensure export path.
var dir = new FileInfo(exportPath).Directory;
if (dir != null && !dir.Exists) {
Expand All @@ -34,7 +34,7 @@ public static string ExportPackage (string exportPath) {

// Export
AssetDatabase.ExportPackage(
GetAssetPaths(),
assetPaths,
exportPath,
ExportPackageOptions.Default
);
Expand All @@ -51,5 +51,11 @@ public static string[] GetAssetPaths () {
return assets;
}

public static string[] GetVRMShaderUpdateAssetPaths () {
return new string[] {
"Assets/VRMShaders/VRM/IO/Runtime/PreShaderPropExporter.cs",
"Assets/VRMShaders/VRM/IO/Runtime/PreShaderPropExporter.cs.meta"
};
}
}
}

0 comments on commit 9246d08

Please sign in to comment.