Tanoda
AnimatorOverrideAnimationClipMapper.cs
Go to the documentation of this file.
1using UnityEngine;
2
4{
6 public class AnimatorOverrideAnimationClipMapper : AnimationClipMapper
7 {
12
14 public override AnimationClip[] MapArray(AssetLoaderContext assetLoaderContext, AnimationClip[] sourceAnimationClips)
15 {
16 var animator = assetLoaderContext.RootGameObject.GetComponent<Animator>();
17 if (animator == null || AnimatorOverrideController == null)
18 {
19 if (assetLoaderContext.Options.ShowLoadingWarnings)
20 {
21 Debug.LogWarning("Tried to execute an AnimatorOverrideController Mapper on a GameObject without an Animator or without setting an AnimatorOverrideController.");
22 }
23 return sourceAnimationClips;
24 }
25 animator.runtimeAnimatorController = AnimatorOverrideController;
26 return sourceAnimationClips;
27 }
28 }
29}
UnityEngine.Debug Debug
Definition: TanodaServer.cs:19
Represents a Mapper used to fill Animator Override Animation Clips.
override AnimationClip[] MapArray(AssetLoaderContext assetLoaderContext, AnimationClip[] sourceAnimationClips)
AnimatorOverrideController AnimatorOverrideController
Animator controller override to use on the animator.