From 8ca2a4601385ebc2bee8d4c8ec49da9bcf25d14d Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 8 Sep 2021 19:07:54 +0900 Subject: [PATCH] fix SimpleViewer. play gltf animation --- Assets/VRM/Samples/SimpleViewer/ViewerUI.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Assets/VRM/Samples/SimpleViewer/ViewerUI.cs b/Assets/VRM/Samples/SimpleViewer/ViewerUI.cs index 2f38896da..c9c23c02e 100644 --- a/Assets/VRM/Samples/SimpleViewer/ViewerUI.cs +++ b/Assets/VRM/Samples/SimpleViewer/ViewerUI.cs @@ -226,6 +226,7 @@ namespace VRM.SimpleViewer var lookAt = instance.GetComponent(); if (lookAt != null) { + // vrm _pose = _instance.gameObject.AddComponent(); _pose.Source = src; _pose.SourceType = HumanPoseTransfer.HumanPoseTransferSourceType.HumanPoseTransfer; @@ -236,14 +237,15 @@ namespace VRM.SimpleViewer lookAt.Target = lookAtTarget; lookAt.UpdateType = UpdateType.LateUpdate; // after HumanPoseTransfer's setPose - var animation = instance.GetComponent(); - if (animation && animation.clip != null) - { - animation.Play(animation.clip.name); - } - m_proxy = instance.GetComponent(); } + + // not vrm + var animation = instance.GetComponent(); + if (animation && animation.clip != null) + { + animation.Play(animation.clip.name); + } } public void Dispose()