Skip to content

Commit

Permalink
fix AnimationValidator
Browse files Browse the repository at this point in the history
vrm-c#2319 これかも
  • Loading branch information
ousttrue committed Jul 24, 2024
1 parent ca0e062 commit 652ac53
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Assets/UniGLTF/Editor/Animation/AnimationValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ public static IEnumerable<Validation> Validate(GameObject root)
}

var animationClips = new List<AnimationClip>();
var animator = root.GetComponent<Animator>();
var animation = root.GetComponent<UnityEngine.Animation>();
if (animator != null)
if (root.TryGetComponent<Animator>(out var animator))
{
animationClips = AnimationExporter.GetAnimationClips(animator);
}
else if (animation != null)
if (root.TryGetComponent<Animation>(out var animation))
{
animationClips = AnimationExporter.GetAnimationClips(animation);
}
Expand Down

0 comments on commit 652ac53

Please sign in to comment.