From 652ac53cc9b816df1c6e6647bc3ca2ba9b9f021a Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 24 Jul 2024 20:30:44 +0900 Subject: [PATCH] =?UTF-8?q?fix=20AnimationValidator=20#2319=20=E3=81=93?= =?UTF-8?q?=E3=82=8C=E3=81=8B=E3=82=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/UniGLTF/Editor/Animation/AnimationValidator.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Assets/UniGLTF/Editor/Animation/AnimationValidator.cs b/Assets/UniGLTF/Editor/Animation/AnimationValidator.cs index 91812a93d3..f44def57dc 100644 --- a/Assets/UniGLTF/Editor/Animation/AnimationValidator.cs +++ b/Assets/UniGLTF/Editor/Animation/AnimationValidator.cs @@ -23,13 +23,11 @@ public static IEnumerable Validate(GameObject root) } var animationClips = new List(); - var animator = root.GetComponent(); - var animation = root.GetComponent(); - if (animator != null) + if (root.TryGetComponent(out var animator)) { animationClips = AnimationExporter.GetAnimationClips(animator); } - else if (animation != null) + if (root.TryGetComponent(out var animation)) { animationClips = AnimationExporter.GetAnimationClips(animation); }