restore sample unitypackage creation

This commit is contained in:
ousttrue 2025-12-08 14:34:02 +09:00
parent 018eae39c1
commit fee817ed26

View File

@ -225,6 +225,13 @@ namespace VRM.DevOnly.PackageExporter
new GlobList("Packages/VRM"), new GlobList("Packages/VRM"),
} }
}, },
// VRM_Samples
new PackageInfo("UniVRM_Samples")
{
List = new []{
new GlobList("Assets/VRM_Samples"),
}
},
// VRM-1.0 // VRM-1.0
new PackageInfo("VRM") new PackageInfo("VRM")
{ {
@ -233,6 +240,13 @@ namespace VRM.DevOnly.PackageExporter
new GlobList("Packages/VRM10"), new GlobList("Packages/VRM10"),
} }
}, },
// VRM-1.0_Samples
new PackageInfo("VRM_Samples")
{
List = new []{
new GlobList("Assets/VRM10_Samples"),
}
},
}; };
foreach (var package in packages) foreach (var package in packages)
{ {
@ -255,18 +269,25 @@ namespace VRM.DevOnly.PackageExporter
private static string FilePathToPackage(string src) private static string FilePathToPackage(string src)
{ {
var items = src.Split("/"); var items = src.Split("/");
if (items[0] != "Packages") switch (items[0])
{ {
throw new ArgumentException(src); case "Assets":
} // pass through(for sample package)
if (PkgMap.TryGetValue(items[1], out var pkg)) return src;
{
items[1] = pkg; case "Packages":
return string.Join("/", items); if (PkgMap.TryGetValue(items[1], out var pkg))
} {
else items[1] = pkg;
{ return string.Join("/", items);
throw new ArgumentException(src); }
else
{
throw new ArgumentException(src);
}
default:
throw new ArgumentException(src);
} }
} }