VRMImporterContext.ModelOwnResources

This commit is contained in:
ousttrue
2021-02-26 19:07:17 +09:00
parent 2e6ded5a7f
commit 7657e62893
2 changed files with 20 additions and 6 deletions

View File

@@ -248,7 +248,7 @@ namespace UniGLTF
/// Root ヒエラルキーで使っているリソース
/// </summary>
/// <returns></returns>
public virtual IEnumerable<UnityEngine.Object> ResourcesInRootHierarchy()
public virtual IEnumerable<UnityEngine.Object> ModelOwnResources()
{
foreach (var mesh in Meshes)
{
@@ -271,7 +271,7 @@ namespace UniGLTF
public UnityResourceDestroyer DisposeOnGameObjectDestroyed()
{
var destroyer = Root.AddComponent<UnityResourceDestroyer>();
foreach (var x in ResourcesInRootHierarchy())
foreach (var x in ModelOwnResources())
{
destroyer.Resources.Add(x);
}

View File

@@ -3,7 +3,6 @@ using System.Linq;
using System.Collections.Generic;
using UniGLTF;
using UnityEngine;
using System.IO;
using UniJSON;
using UniGLTF.AltTask;
@@ -298,8 +297,23 @@ namespace VRM
return meta;
}
public override IEnumerable<UnityEngine.Object> ModelOwnResources()
{
foreach (var x in base.ModelOwnResources())
{
yield return x;
}
// VRM 固有のリソース(ScriptableObject)
yield return HumanoidAvatar;
yield return AvatarDescription;
yield return Meta;
foreach (var x in BlendShapeAvatar.Clips)
{
yield return x;
}
yield return BlendShapeAvatar;
}
}
}