mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-09 19:48:09 -05:00
fix SimpleViewer. play gltf animation
This commit is contained in:
parent
a2307b42b8
commit
8ca2a46013
|
|
@ -226,6 +226,7 @@ namespace VRM.SimpleViewer
|
|||
var lookAt = instance.GetComponent<VRMLookAtHead>();
|
||||
if (lookAt != null)
|
||||
{
|
||||
// vrm
|
||||
_pose = _instance.gameObject.AddComponent<HumanPoseTransfer>();
|
||||
_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<Animation>();
|
||||
if (animation && animation.clip != null)
|
||||
{
|
||||
animation.Play(animation.clip.name);
|
||||
}
|
||||
|
||||
m_proxy = instance.GetComponent<VRMBlendShapeProxy>();
|
||||
}
|
||||
|
||||
// not vrm
|
||||
var animation = instance.GetComponent<Animation>();
|
||||
if (animation && animation.clip != null)
|
||||
{
|
||||
animation.Play(animation.clip.name);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user