1using System.Diagnostics;
2using System.Collections.Generic;
46 Animator currentAnimator =
null;
47 List<KeyValuePair<AnimationClip, AnimationClip>> animsKeyValuePairList =
new List<KeyValuePair<AnimationClip, AnimationClip>>();
49 string animatorSOAssetName = characterAttribute.
characterPart.ToString();
52 Animator[] animatorsArray =
m_Character.GetComponentsInChildren<Animator>();
54 foreach( Animator animator
in animatorsArray )
56 if ( animator.name == animatorSOAssetName )
58 currentAnimator = animator;
64 AnimatorOverrideController aoc =
new AnimatorOverrideController( currentAnimator.runtimeAnimatorController );
65 List<AnimationClip> animationList =
new List<AnimationClip>( aoc.animationClips );
67 foreach( AnimationClip animationClip
in animationList )
74 if( hasFoundAnimation )
82 if( hasFoundAnimation )
86 animsKeyValuePairList.Add(
new KeyValuePair<AnimationClip, AnimationClip>( animationClip, swapAnimationClip ) );
92 aoc.ApplyOverrides( animsKeyValuePairList );
93 currentAnimator.runtimeAnimatorController = aoc;
Dictionary< string, SO_AnimationType > m_AnimationTypeDictionaryByCompositeAttributeKey
Dictionary< AnimationClip, SO_AnimationType > m_AnimationTypeDictionaryByAnimation
void Start()
Initialize the lists
SO_AnimationType[] m_SOAnimationTypeArray
void ApplyCharacterCustomisationParameters(List< CharacterAttribute > characterAttributesList)
Handles the animation overrides
Create a scriptable animation type. This objects holds infomration about animation variants.
AnimationName m_AnimationName
CharacterPartAnimator m_CharacterPart
PartVariantColor m_PartVariantColor
PartVariantType m_PartVariantType
AnimationClip m_AnimationClip
Define what character variant we want to switch into.
PartVariantType partVariantType
PartVariantColor partVariantColor
CharacterPartAnimator characterPart