/// <summary> /// update current animation ant transitions /// </summary> /// <param name="newContext"></param> void UpdateContext(AnimationNode newContext) { CurrentAnimation = newContext; TargetAnimator.AnimationData = CurrentAnimation.MainAnimation; TargetAnimator.Play(); TargetAnimator.IsRepeat = CurrentAnimation.Repeat; }
public void RemoveAnimation(AnimationNode node) { if (animationList.Contains(node)) { animationList.Remove(node); } }
/// <summary> /// /// </summary> /// <param name="node"></param> public void AddAnimation(AnimationNode node) { if (!animationList.Contains(node)) { animationList.Add(node); } }
public AnimationController(AnimationNode animation) { CurrentAnimation = animation; animationList = new List <AnimationNode>(); AddAnimation(animation); boolDict = new Dictionary <string, bool>(); floatDict = new Dictionary <string, float>(); intDict = new Dictionary <string, int>(); }
public AnimationTransition(Predicate <AnimationController> condition, AnimationNode target) { Condition = condition; TargetAnimation = target; }
/// <summary> /// Set current animation and its transition /// </summary> public void SetEntry(AnimationNode node) { CurrentAnimation = node; AddAnimation(node); }