Beispiel #1
0
            public Loaded(RuntimeGltfInstance instance, HumanPoseTransfer src, Transform lookAtTarget)
            {
                m_instance = instance;

                m_controller = instance.GetComponent <Vrm10Instance>();
                if (m_controller != null)
                {
                    // VRM
                    m_controller.UpdateType = Vrm10Instance.UpdateTypes.LateUpdate; // after HumanPoseTransfer's setPose
                    {
                        m_pose            = instance.gameObject.AddComponent <HumanPoseTransfer>();
                        m_pose.Source     = src;
                        m_pose.SourceType = HumanPoseTransfer.HumanPoseTransferSourceType.HumanPoseTransfer;

                        m_lipSync        = instance.gameObject.AddComponent <VRM10AIUEO>();
                        m_blink          = instance.gameObject.AddComponent <VRM10Blinker>();
                        m_autoExpression = instance.gameObject.AddComponent <VRM10AutoExpression>();

                        m_controller.LookAtTargetType = VRM10ObjectLookAt.LookAtTargetTypes.CalcYawPitchToGaze;
                        m_controller.Gaze             = lookAtTarget;
                    }
                }

                var animation = instance.GetComponent <Animation>();

                if (animation && animation.clip != null)
                {
                    // GLTF animation
                    animation.Play(animation.clip.name);
                }
            }
Beispiel #2
0
 private void Awake()
 {
     if (Controller == null)
     {
         Controller = GetComponent <Vrm10Instance>();
     }
 }
Beispiel #3
0
 private void OnEnable()
 {
     m_controller = GetComponent <Vrm10Instance>();
     m_coroutine  = StartCoroutine(BlinkRoutine());
 }
Beispiel #4
0
 private void Reset()
 {
     Controller = GetComponent <Vrm10Instance>();
 }