Tanoda
SimpleAnimationPlayerAnimationClipMapper.cs
Go to the documentation of this file.
1using TriLibCore.General;
3using UnityEngine;
4
5namespace TriLibCore.Mappers
6{
8 [CreateAssetMenu(menuName = "TriLib/Mappers/Animation Clip/Simple Animation Player Animation Clip Mapper", fileName = "SimpleAnimationPlayerAnimationClipMapper")]
9 public class SimpleAnimationPlayerAnimationClipMapper : AnimationClipMapper
10 {
12 public override AnimationClip[] MapArray(AssetLoaderContext assetLoaderContext, AnimationClip[] sourceAnimationClips)
13 {
14 if ((assetLoaderContext.Options.AnimationType == AnimationType.Generic || assetLoaderContext.Options.AnimationType == AnimationType.Humanoid) && sourceAnimationClips.Length > 0)
15 {
16 var simpleAnimationPlayer = assetLoaderContext.RootGameObject.AddComponent<SimpleAnimationPlayer>();
17 simpleAnimationPlayer.AnimationClips = sourceAnimationClips;
18 simpleAnimationPlayer.enabled = false;
19 }
20 return sourceAnimationClips;
21 }
22 }
23}
Represents a Mapper that creates a Simple Animation Player used to play Animation Clips by their inde...
override AnimationClip[] MapArray(AssetLoaderContext assetLoaderContext, AnimationClip[] sourceAnimationClips)
Represents a Playable used to play Animations from its Animation Clip List using names or indices as ...
IList< AnimationClip > AnimationClips
Source animation clips.