mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-26 12:55:18 -05:00
VRMImporterContext.ModelOwnResources
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user