mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-09 04:19:42 -05:00
Skip AssetPostProcessor when file in StreamingAssets folder. #166
This commit is contained in:
@@ -15,6 +15,12 @@ namespace UniGLTF
|
||||
{
|
||||
foreach (string path in importedAssets)
|
||||
{
|
||||
if (UnityPath.FromUnityPath(path).IsStreamingAsset)
|
||||
{
|
||||
Debug.LogFormat("Skip StreamingAssets: {0}", path);
|
||||
continue;
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
switch (ext)
|
||||
{
|
||||
|
||||
@@ -44,6 +44,19 @@ namespace UniGLTF
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsStreamingAsset
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsNull)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return FullPath.StartsWith(Application.streamingAssetsPath + "/");
|
||||
}
|
||||
}
|
||||
|
||||
public string FileNameWithoutExtension
|
||||
{
|
||||
get { return Path.GetFileNameWithoutExtension(Value); }
|
||||
|
||||
@@ -8,10 +8,23 @@ namespace UniHumanoid
|
||||
{
|
||||
public class bvhAssetPostprocessor : AssetPostprocessor
|
||||
{
|
||||
static bool IsStreamingAsset(string path)
|
||||
{
|
||||
var baseFullPath = Path.GetFullPath(Application.dataPath + "/..").Replace("\\", "/");
|
||||
path = Path.Combine(baseFullPath, path).Replace("\\", "/");
|
||||
return path.StartsWith(Application.streamingAssetsPath + "/");
|
||||
}
|
||||
|
||||
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
|
||||
{
|
||||
foreach (string path in importedAssets)
|
||||
{
|
||||
if (IsStreamingAsset(path))
|
||||
{
|
||||
Debug.LogFormat("Skip StreamingAssets: {0}", path);
|
||||
continue;
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
if (ext == ".bvh")
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using UniGLTF;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace VRM
|
||||
@@ -14,6 +15,12 @@ namespace VRM
|
||||
{
|
||||
foreach (string path in importedAssets)
|
||||
{
|
||||
if (UnityPath.FromUnityPath(path).IsStreamingAsset)
|
||||
{
|
||||
Debug.LogFormat("Skip StreamingAssets: {0}", path);
|
||||
continue;
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(path).ToLower();
|
||||
if (ext == ".vrm")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user