AnimatorManager
public class AnimatorManager : MonoBehaviour
{
public Animator animator;
public string currentAnimationName;
public float animationDuration;//measured in seconds
//...
This is a wrapper to help Unity's animator work more friendly with Cyborg Netcode and give a degree of determinism
Methods
public void Update()
Makes sure the Unity Animator is not enabled. We want the EntityManager to control how often this animation is updated to attempt to keep things in sync
public void UpdateAnimation()
Updates the animation by 1 Time.fixedTimeDelta and calls UpdateSprite
public float GetAnimationLength()
Gets the animations length in the unit of seconds
public bool DoesCurrentAnimationLoop()
Does it loop? True/False
public void SetCurrentAnimation(int a)
Sets current animation by index
public void SetCurrentAnimation(string a)
Sets current animation by animation name
public void SetCurrentAnimationIfNotCurrentAnimation(string name)
Sets current animation by string ONLY IF the current animation is not what we are trying to set it to
public int GetCurrentAnimationIndex()
Gets current animation index. I don't know how to explain this another way
public int GetAnimationIndex(string name)
Gets index of an animation within the animator with matching name. Returns 0 if it cant find it.
public bool IsAnimationFinished()
Has this animation completed its animation? Always true if looping animation