示例#1
0
        public static IEnumerable <Validation> Validate(this VRMFirstPerson self)
        {
            Hierarchy = self.GetComponentsInChildren <Transform>(true);

            for (int i = 0; i < self.Renderers.Count; ++i)
            {
                if (!IsValid(self.Renderers[i], $"[VRMFirstPerson]{self.name}.Renderers[{i}]", out Validation v))
                {
                    yield return(v);
                }
            }
        }
        public static IEnumerable <Validation> Validate(this VRMFirstPerson self, GameObject _)
        {
            Hierarchy = self.GetComponentsInChildren <Transform>(true);

            extended = () =>
            {
                if (GUILayout.Button("reset VRMFirstPerson.Renderers"))
                {
                    self.TraverseRenderers();
                }
            };

            for (int i = 0; i < self.Renderers.Count; ++i)
            {
                if (!IsValid(self.Renderers[i], $"[VRMFirstPerson]{self.name}.Renderers[{i}]", out Validation v))
                {
                    yield return(v);
                }
            }
        }
示例#3
0
        public static IEnumerable <Validation> Validate(this VRMFirstPerson self)
        {
            var hierarchy = self.GetComponentsInChildren <Transform>(true);

            for (int i = 0; i < self.Renderers.Count; ++i)
            {
                var r = self.Renderers[i];
                if (r.Renderer == null)
                {
                    yield return(Validation.Error($"[VRMFirstPerson]{self.name}.Renderers[{i}].Renderer is null"));
                }
                if (!hierarchy.Contains(r.Renderer.transform))
                {
                    yield return(Validation.Error($"[VRMFirstPerson]{self.name}.Renderers[{i}].Renderer is out of hierarchy"));
                }
                if (!r.Renderer.EnableForExport())
                {
                    yield return(Validation.Error($"[VRMFirstPerson]{self.name}.Renderers[{i}].Renderer is not active"));
                }
            }
            yield break;
        }
示例#4
0
        void SetupTarget()
        {
            if (m_target != null)
            {
                m_target.Source     = m_source;
                m_target.SourceType = UniHumanoid.HumanPoseTransfer.HumanPoseTransferSourceType.HumanPoseTransfer;

                m_blendShape = m_target.GetComponent <VRMBlendShapeProxy>();

                m_firstPerson = m_target.GetComponent <VRMFirstPerson>();

                var animator = m_target.GetComponent <Animator>();
                if (animator != null)
                {
                    m_firstPerson.Setup();

                    if (m_faceCamera != null)
                    {
                        m_faceCamera.Target = animator.GetBoneTransform(HumanBodyBones.Head);
                    }
                }
            }
        }
示例#5
0
 void OnEnable()
 {
     m_target = target as VRMFirstPerson;
 }