From cd158ec430ac48075da98838d42ba88708e58b70 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 1 Sep 2020 11:57:33 +0900 Subject: [PATCH] =?UTF-8?q?VRMFirstPerson.Validate=20=E3=81=AE=E3=83=A1?= =?UTF-8?q?=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=AB=20prefix=20?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82out=20of=20hierarchy?= =?UTF-8?q?=E3=80=80=E3=81=A8=20not=20active=20=E3=81=AE=E5=8C=BA=E5=88=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VRM/UniVRM/Scripts/FirstPerson/VRMFirstPerson.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Assets/VRM/UniVRM/Scripts/FirstPerson/VRMFirstPerson.cs b/Assets/VRM/UniVRM/Scripts/FirstPerson/VRMFirstPerson.cs index 11b59375c..480032843 100644 --- a/Assets/VRM/UniVRM/Scripts/FirstPerson/VRMFirstPerson.cs +++ b/Assets/VRM/UniVRM/Scripts/FirstPerson/VRMFirstPerson.cs @@ -52,18 +52,22 @@ namespace VRM public IEnumerable Validate() { - var hierarchy = GetComponentsInChildren(); + var hierarchy = GetComponentsInChildren(true); for (int i = 0; i < Renderers.Count; ++i) { var r = Renderers[i]; if (r.Renderer == null) { - yield return Validation.Error($"{name}.Renderers[{i}].Renderer is null"); + yield return Validation.Error($"[VRMFirstPerson]{name}.Renderers[{i}].Renderer is null"); } if (!hierarchy.Contains(r.Renderer.transform)) { - yield return Validation.Error($"{name}.Renderers[{i}].Renderer is out of hierarchy"); + yield return Validation.Error($"[VRMFirstPerson]{name}.Renderers[{i}].Renderer is out of hierarchy"); + } + if (!r.Renderer.gameObject.activeInHierarchy) + { + yield return Validation.Error($"[VRMFirstPerson]{name}.Renderers[{i}].Renderer is not active"); } } yield break;