Merge pull request #2014 from ousttrue/fix/simple_viewer

[sample] SimpleViewer を修復(BvhImporterContext の挙動変更に追随)
This commit is contained in:
ousttrue
2023-03-13 15:51:37 +09:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -116,6 +116,8 @@ namespace UniHumanoid
AvatarDescription = description;
var animator = Root.AddComponent<Animator>();
animator.avatar = Avatar;
Root.AddComponent<HumanPoseTransfer>();
}
static Transform BuildHierarchy(Transform parent, BvhNode node, float toMeter)

View File

@@ -226,7 +226,10 @@ namespace VRM.SimpleViewer
context.Parse(path, source);
context.Load();
m_src = context.Root.GetComponent<HumanPoseTransfer>();
m_src.GetComponent<Renderer>().enabled = false;
if (m_src == null)
{
throw new ArgumentNullException();
}
m_loaded?.EnableBvh(m_src);
}