CanExtract

This commit is contained in:
ousttrue 2021-06-24 18:46:12 +09:00
parent 1ea276e959
commit 8080bf7ab6
4 changed files with 11 additions and 7 deletions

View File

@ -30,7 +30,7 @@ namespace UniGLTF
}
else
{
if (GUILayout.Button("Clear extraction."))
if (GUILayout.Button("Clear extraction"))
{
ClearExternalObjects(importer, typeof(AnimationClip));
}

View File

@ -66,11 +66,15 @@ namespace UniGLTF
/// <returns></returns>
protected bool CanExtract(ScriptedImporter importer)
{
var subAssets = AssetDatabase.LoadAllAssetsAtPath(importer.assetPath);
foreach (var key in m_keys)
foreach (var (k, v) in importer.GetExternalObjectMap())
{
foreach (var key in m_keys)
{
if (k.type.IsAssignableFrom(key.Type))
{
return false;
}
}
}
return true;

View File

@ -40,7 +40,7 @@ namespace UniGLTF
}
else
{
if (GUILayout.Button("Clear extraction."))
if (GUILayout.Button("Clear extraction"))
{
ClearExternalObjects(importer, typeof(Texture), typeof(Material));
}

View File

@ -30,7 +30,7 @@ namespace UniVRM10
}
else
{
if (GUILayout.Button("Clear extraction."))
if (GUILayout.Button("Clear extraction"))
{
ClearExternalObjects(importer, typeof(VRM10Object), typeof(VRM10Expression));
}