Class SimpleAnimationPlayerAnimationClipMapper
Implements an TriLibCore.Mappers.AnimationClipMapper that creates a SimpleAnimationPlayer for playing animation clips by index or name. When the animation type is set to Generic or Humanoid, and at least one animation clip is available, this mapper adds a SimpleAnimationPlayer to the model's root GameObject and assigns the animation clips to it.
Inheritance
Inherited Members
Namespace: TriLibCore.Mappers
Assembly: Assembly-CSharp.dll
Syntax
[CreateAssetMenu(menuName = "TriLib/Mappers/Animation Clip/Simple Animation Player Animation Clip Mapper", fileName = "SimpleAnimationPlayerAnimationClipMapper")]
public class SimpleAnimationPlayerAnimationClipMapper : AnimationClipMapper
Methods
MapArray(AssetLoaderContext, AnimationClip[])
Declaration
public override AnimationClip[] MapArray(AssetLoaderContext assetLoaderContext, AnimationClip[] sourceAnimationClips)
Parameters
Type | Name | Description |
---|---|---|
AssetLoaderContext | assetLoaderContext | The context used to load the model, which includes settings, references to the root GameObject, and other loading data. |
AnimationClip[] | sourceAnimationClips | An array of animation clips loaded from the model. |
Returns
Type | Description |
---|---|
AnimationClip[] | The same array of animation clips that was passed in ( |
Overrides
Remarks
If the TriLibCore.AssetLoaderOptions.AnimationType is either Generic or Humanoid, and there are one or more
animation clips provided (sourceAnimationClips
is not empty), the mapper adds a
SimpleAnimationPlayer component to the root GameObject (from TriLibCore.AssetLoaderContext.RootGameObject)
and assigns the animation clips to its AnimationClips array. The animation player
is initially disabled to allow for further configuration if necessary.
The original animation clips are always returned.