Interface IAnimationManager
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Everything needed for allowing animations the Entity class holds a reference to an IAnimator. Currently implemented by ServerAnimator
public interface IAnimationManager : IDisposable
- Inherited Members
- Extension Methods
Properties
ActiveAnimationsByAnimCode
Gets the AnimationMetaData for the target action.
Dictionary<string, AnimationMetaData> ActiveAnimationsByAnimCode { get; }
Property Value
AnimationsDirty
Whether or not the animation is dirty.
bool AnimationsDirty { get; set; }
Property Value
Animator
The animator for this animation manager
IAnimator Animator { get; set; }
Property Value
HeadController
The head controller for this manager.
EntityHeadController HeadController { get; set; }
Property Value
Methods
CopyOverAnimStates(RunningAnimation[], IAnimator)
void CopyOverAnimStates(RunningAnimation[] copyOverAnims, IAnimator animator)
Parameters
copyOverAnims
RunningAnimation[]animator
IAnimator
FromAttributes(ITreeAttribute, string)
Additional attributes applied to the animation
void FromAttributes(ITreeAttribute tree, string version)
Parameters
tree
ITreeAttributeversion
string
GetAnimationState(string)
RunningAnimation GetAnimationState(string anim)
Parameters
anim
string
Returns
Init(ICoreAPI, Entity)
Initialization call for the animation manager.
void Init(ICoreAPI api, Entity entity)
Parameters
IsAnimationActive(params string[])
bool IsAnimationActive(params string[] anims)
Parameters
anims
string[]
Returns
LoadAnimator(ICoreAPI, Entity, Shape, RunningAnimation[], bool, params string[])
IAnimator LoadAnimator(ICoreAPI api, Entity entity, Shape entityShape, RunningAnimation[] copyOverAnims, bool requirePosesOnServer, params string[] requireJointsForElements)
Parameters
api
ICoreAPIentity
EntityentityShape
ShapecopyOverAnims
RunningAnimation[]requirePosesOnServer
boolrequireJointsForElements
string[]
Returns
OnClientFrame(float)
void OnClientFrame(float dt)
Parameters
dt
float
OnReceivedServerAnimations(int[], int, float[])
The event fired when the client recieves the server animations
void OnReceivedServerAnimations(int[] activeAnimations, int activeAnimationsCount, float[] activeAnimationSpeeds)
Parameters
activeAnimations
int[]all of active animations
activeAnimationsCount
intthe number of the animations
activeAnimationSpeeds
float[]The speed of those animations.
OnServerTick(float)
void OnServerTick(float dt)
Parameters
dt
float
RegisterFrameCallback(AnimFrameCallback)
void RegisterFrameCallback(AnimFrameCallback trigger)
Parameters
trigger
AnimFrameCallback
ResetAnimation(string)
If given animation is running, will set its progress to the first animation frame
void ResetAnimation(string beginholdAnim)
Parameters
beginholdAnim
string
ShouldPlaySound(AnimationSound)
void ShouldPlaySound(AnimationSound sound)
Parameters
sound
AnimationSound
StartAnimation(string)
Starts an animation based on JSON code.
bool StartAnimation(string configCode)
Parameters
configCode
stringThe json code.
Returns
StartAnimation(AnimationMetaData)
Starts an animation based on the AnimationMetaData
bool StartAnimation(AnimationMetaData animdata)
Parameters
animdata
AnimationMetaData
Returns
StopAnimation(string)
Stops the animation.
void StopAnimation(string code)
Parameters
code
stringThe code to stop the animation on
ToAttributes(ITreeAttribute, bool)
Additional attributes applied from the animation
void ToAttributes(ITreeAttribute tree, bool forClient)
Parameters
tree
ITreeAttributeforClient
bool
TriggerAnimationStopped(string)
The event fired when the animation is stopped.
void TriggerAnimationStopped(string code)
Parameters
code
stringThe code that the animation stopped with.
Events
OnAnimationReceived
event StartAnimationDelegate OnAnimationReceived
Event Type
OnAnimationStopped
event Action<string> OnAnimationStopped
Event Type
OnStartAnimation
event StartAnimationDelegate OnStartAnimation