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

                var lookAt = instance.GetComponent <VRMLookAtHead>();

                if (lookAt != null)
                {
                    // vrm
                    _pose            = _instance.gameObject.AddComponent <HumanPoseTransfer>();
                    _pose.Source     = src;
                    _pose.SourceType = HumanPoseTransfer.HumanPoseTransferSourceType.HumanPoseTransfer;

                    m_lipSync = instance.gameObject.AddComponent <AIUEO>();
                    m_blink   = instance.gameObject.AddComponent <Blinker>();

                    lookAt.Target     = lookAtTarget;
                    lookAt.UpdateType = UpdateType.LateUpdate; // after HumanPoseTransfer's setPose

                    m_proxy = instance.GetComponent <VRMBlendShapeProxy>();
                }

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

                if (animation && animation.clip != null)
                {
                    animation.Play(animation.clip.name);
                }
            }
Exemple #2
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);
                }
            }