AnimationLayerComponent

Namespace: SharpPluginLoader.Core.Components

Represents an instance of the cpAnimationLayer class.

public class AnimationLayerComponent : Component

Inheritance ObjectNativeWrapperMtObjectComponentAnimationLayerComponent

Properties

Owner

The owner of this animation layer.

public Entity Owner { get; }

Property Value

Entity

CurrentFrame

The current frame of the animation.

public Single& CurrentFrame { get; }

Property Value

Single&

MaxFrame

The frame count of the animation.

public Single& MaxFrame { get; }

Property Value

Single&

Speed

The speed of the animation.

public Single& Speed { get; }

Property Value

Single&

Paused

Gets or sets whether the animation is paused.

public bool Paused { get; set; }

Property Value

Boolean

Next

Gets the next component in the list.

public Component Next { get; }

Property Value

Component

Owner

Gets the owner of this component.

public Model Owner { get; }

Property Value

Model

Instance

The native pointer.

public nint Instance { get; set; }

Property Value

IntPtr

Constructors

AnimationLayerComponent(IntPtr)

public AnimationLayerComponent(nint instance)

Parameters

instance IntPtr

AnimationLayerComponent()

public AnimationLayerComponent()

Methods

LockSpeed(Single)

Locks the speed of this animation layer.

public void LockSpeed(float speed)

Parameters

speed Single
The speed to lock it to

UnlockSpeed()

Unlocks the speed of this animation layer.

public void UnlockSpeed()

Pause()

Pauses the animation layer.

public void Pause()

Resume()

Resumes the animation layer.

public void Resume()

RegisterLmt(MotionList, UInt32)

Registers an LMT to this animation layer.

public void RegisterLmt(MotionList lmt, uint index)

Parameters

lmt MotionList
The lmt to register

index UInt32
The index to register the lmt in. Must be less than 16

Exceptions

ArgumentOutOfRangeException

InvalidOperationException

DoAnimation(AnimationId, Single, Single, Single, UInt32)

Forces the animation layer to do the given animation. This will interrupt the current animation.

public void DoAnimation(AnimationId id, float interpolationFrame, float startFrame, float speed, uint attr)

Parameters

id AnimationId
The id of the animation

interpolationFrame Single
The amount of frames used to interpolate. 0 will auto-calculate the necessary frames

startFrame Single
The starting frame of the animation

speed Single
The initial speed of the animation

attr UInt32
Additional flags

DoAnimationSafe(AnimationId, Single, Single, Single, UInt32)

Forces the animation layer to do the given animation. This will interrupt the current animation.

public void DoAnimationSafe(AnimationId id, float interpolationFrame, float startFrame, float speed, uint attr)

Parameters

id AnimationId
The id of the animation

interpolationFrame Single
The amount of frames used to interpolate. 0 will auto-calculate the necessary frames

startFrame Single
The starting frame of the animation

speed Single
The initial speed of the animation

attr UInt32
Additional flags

Remarks:

If the owner object of the animation layer this function is called on is an entity, it will instead call the function dedicated to entities. Note that in that case the parameter will be ignored.