Class NoAnimationManager
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
A No-Animation Manager built off of IAnimationManager. Open in GitHub
public class NoAnimationManager : IAnimationManager, IDisposable
- Inheritance
-
NoAnimationManager
- Implements
- Inherited Members
- Extension Methods
Constructors
NoAnimationManager()
public NoAnimationManager()
Properties
ActiveAnimationsByAnimCode
Gets the AnimationMetaData for the target action.
public Dictionary<string, AnimationMetaData> ActiveAnimationsByAnimCode { get; }
Property Value
AdjustCollisionBoxToAnimation
public bool AdjustCollisionBoxToAnimation { get; }
Property Value
AnimationsDirty
Whether or not the animation is dirty.
public bool AnimationsDirty { get; set; }
Property Value
Animator
The animator for this animation manager
public IAnimator Animator { get; set; }
Property Value
HeadController
The head controller for this manager.
public EntityHeadController HeadController { get; set; }
Property Value
Methods
CopyOverAnimStates(RunningAnimation[], IAnimator)
public void CopyOverAnimStates(RunningAnimation[] copyOverAnims, IAnimator animator)
Parameters
copyOverAnimsRunningAnimation[]animatorIAnimator
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
FromAttributes(ITreeAttribute, string)
Additional attributes applied to the animation
public void FromAttributes(ITreeAttribute tree, string version)
Parameters
treeITreeAttributeversionstring
GetAnimationState(string)
public RunningAnimation GetAnimationState(string anim)
Parameters
animstring
Returns
Init(ICoreAPI, Entity)
Initialization call for the animation manager.
public void Init(ICoreAPI api, Entity entity)
Parameters
IsAnimationActive(params string[])
public bool IsAnimationActive(params string[] anims)
Parameters
animsstring[]
Returns
LoadAnimator(ICoreAPI, Entity, Shape, RunningAnimation[], bool, params string[])
public IAnimator LoadAnimator(ICoreAPI api, Entity entity, Shape entityShape, RunningAnimation[] copyOverAnims, bool requirePosesOnServer, params string[] requireJointsForElements)
Parameters
apiICoreAPIentityEntityentityShapeShapecopyOverAnimsRunningAnimation[]requirePosesOnServerboolrequireJointsForElementsstring[]
Returns
OnClientFrame(float)
public void OnClientFrame(float dt)
Parameters
dtfloat
OnReceivedServerAnimations(int[], int, float[])
The event fired when the client recieves the server animations
public void OnReceivedServerAnimations(int[] activeAnimations, int activeAnimationsCount, float[] activeAnimationSpeeds)
Parameters
activeAnimationsint[]all of active animations
activeAnimationsCountintthe number of the animations
activeAnimationSpeedsfloat[]The speed of those animations.
OnServerTick(float)
public void OnServerTick(float dt)
Parameters
dtfloat
RegisterFrameCallback(AnimFrameCallback)
public void RegisterFrameCallback(AnimFrameCallback trigger)
Parameters
triggerAnimFrameCallback
ResetAnimation(string)
If given animation is running, will set its progress to the first animation frame
public void ResetAnimation(string beginholdAnim)
Parameters
beginholdAnimstring
ShouldPlaySound(AnimationSound)
public void ShouldPlaySound(AnimationSound sound)
Parameters
soundAnimationSound
StartAnimation(string)
Starts an animation based on JSON code.
public bool StartAnimation(string configCode)
Parameters
configCodestringThe json code.
Returns
StartAnimation(AnimationMetaData)
Starts an animation based on the AnimationMetaData
public bool StartAnimation(AnimationMetaData animdata)
Parameters
animdataAnimationMetaData
Returns
StopAllAnimations()
Stops all currently playing animations
public void StopAllAnimations()
StopAnimation(string)
Stops the animation.
public void StopAnimation(string code)
Parameters
codestringThe code to stop the animation on
ToAttributes(ITreeAttribute, bool)
Additional attributes applied from the animation
public void ToAttributes(ITreeAttribute tree, bool forClient)
Parameters
treeITreeAttributeforClientbool
TriggerAnimationStopped(string)
The event fired when the animation is stopped.
public void TriggerAnimationStopped(string code)
Parameters
codestringThe code that the animation stopped with.
TryStartAnimation(AnimationMetaData)
Starts an animation based on the AnimationMetaData, if it exists; returns false if it does not exist (or if unable to start it, e.g. because it is already playing)
public bool TryStartAnimation(AnimationMetaData animdata)
Parameters
animdataAnimationMetaData
Returns
Events
OnAnimationReceived
public event StartAnimationDelegate OnAnimationReceived
Event Type
OnAnimationStopped
public event Action<string> OnAnimationStopped
Event Type
OnStartAnimation
public event StartAnimationDelegate OnStartAnimation