From 5baee4aabf029c0c4b9dae3f4f205fdde5de8ed4 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Mon, 19 Jul 2021 16:41:20 +0900 Subject: [PATCH] Fix the bug about unrelated renderers was manipulated. --- Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs b/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs index f92788385..62eef99ba 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs @@ -104,7 +104,7 @@ namespace UniGLTF public void ShowMeshes() { - foreach (var r in GetComponentsInChildren()) + foreach (var r in Renderers) { r.enabled = true; } @@ -112,9 +112,9 @@ namespace UniGLTF public void EnableUpdateWhenOffscreen() { - foreach (var smr in GetComponentsInChildren()) + foreach (var skinnedMeshRenderer in SkinnedMeshRenderers) { - smr.updateWhenOffscreen = true; + skinnedMeshRenderer.updateWhenOffscreen = true; } }