Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unitypackage #488

Merged
merged 3 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Assets/MeshUtility/MeshUtility.asmdef
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{
"name": "MeshUtility"
}
{
"name": "MeshUtility",
"references": [],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}
43 changes: 13 additions & 30 deletions Assets/VRM/UniVRM/DevOnly/Editor/VRMExportUnityPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ static IEnumerable<string> GlobFiles(string path)

if (Directory.Exists(path))
{
// folder
yield return path.Replace("\\", "/");

foreach (var child in Directory.GetFileSystemEntries(path))
{
foreach (var x in GlobFiles(child))
Expand All @@ -117,6 +120,7 @@ static IEnumerable<string> GlobFiles(string path)
}
else
{
// file
if (Path.GetExtension(path).ToLower() == ".meta")
{
yield break;
Expand Down Expand Up @@ -158,10 +162,12 @@ public GlobList(string root, params string[] filters)
if (filters.Any())
{
var filtersWithRoot = filters.Select(x => $"{root}/{x}").ToArray();
// filtering
Files = files.Where(x => filtersWithRoot.Any(y => x.StartsWith(y))).ToArray();
}
else
{
// no filter. all files
Files = files.ToArray();
}
}
Expand Down Expand Up @@ -190,42 +196,19 @@ public static void CreateUnityPackages(string outputDir)
new GlobList("Assets/VRMShaders"),
}
},
// new PackageInfo("UniJSON-standalone")
// {
// List = new [] {
// new GlobList("Assets/VRM", "UniJSON"),
// }
// },
// new PackageInfo("UniHumanoid-standalone")
// {
// List = new []{
// new GlobList("Assets/VRM", "UniHumanoid"),
// }
// },
// new PackageInfo("UniGLTF-standalone")
// {
// List = new []{
// new GlobList("Assets/VRM", "UniGLTF", "UniHumanoid", "UniJSON", "Assets/VRM/DepthFirstScheduler"),
// new GlobList("Assets/VRMShaders", "UniUnlit"),
// }
// }
new PackageInfo("UniVRM-samples")
{
List = new[]{
new GlobList("Assets/VRM.Samples"),
new GlobList("Assets/StreamingAssets/VRM.Samples"),
}
}
};
foreach (var package in packages)
{
CreateUnityPackage(outputDir, package);
}
}

// UniVRM Samples
{
CreateUnityPackage(outputDir, new PackageInfo("UniVRM-samples")
{
List = new[]{
new GlobList("Assets/VRM.Samples"),
new GlobList("Assets/StreamingAssets/VRM.Samples"),
}
});
}
}

public static void CreateUnityPackage(
Expand Down