mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-28 13:54:45 -05:00
update export package menu
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -35,6 +37,32 @@ namespace VRM
|
||||
return path;
|
||||
}
|
||||
|
||||
static IEnumerable<string> EnumerateFiles(string path)
|
||||
{
|
||||
if (Path.GetFileName(path).StartsWith(".git"))
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
foreach(var child in Directory.GetFileSystemEntries(path))
|
||||
{
|
||||
foreach(var x in EnumerateFiles(child))
|
||||
{
|
||||
yield return x;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetExtension(path).ToLower() != ".meta")
|
||||
{
|
||||
yield return path.Replace("\\", "/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if VRM_DEVELOP
|
||||
[MenuItem("VRM/Export unitypackage")]
|
||||
#endif
|
||||
@@ -48,7 +76,10 @@ namespace VRM
|
||||
return;
|
||||
}
|
||||
|
||||
AssetDatabase.ExportPackage("Assets/VRM", path, ExportPackageOptions.Recurse);
|
||||
var files = EnumerateFiles("Assets/VRM")
|
||||
.ToArray();
|
||||
|
||||
AssetDatabase.ExportPackage(files, path, ExportPackageOptions.Interactive);
|
||||
Debug.LogFormat("exported: {0}", path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ namespace VRM
|
||||
public static class VRMVersion
|
||||
{
|
||||
public const int MAJOR = 0;
|
||||
public const int MINOR = 8;
|
||||
public const int MINOR = 9;
|
||||
|
||||
public const string VERSION = "0.8";
|
||||
public const string VERSION = "0.9";
|
||||
|
||||
public const string DecrementMenuName = "VRM/Version(0.8) Decrement";
|
||||
public const string IncrementMenuName = "VRM/Version(0.8) Increment";
|
||||
public const string DecrementMenuName = "VRM/Version(0.9) Decrement";
|
||||
public const string IncrementMenuName = "VRM/Version(0.9) Increment";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user