Пример #1
0
 public SetAnimator AddAnimationSet(AnimationSet set)
 {
     animationSets.Add(set.name, set);
     animator.AddAnimationSet(set);
     if (CurrentAnimationSet == null)
     {
         CurrentAnimationSet = set;
     }
     return(this);
 }
Пример #2
0
        private void SetupAnimationSets()
        {
            float idleFPS = 4f;
            float dashFPS = 18;

            int directionalSelector() => (int)direction.Direction;

            var idleAnimationSet     = new AnimationSet("idle", directionalSelector, Enumerable.Range(0, 8).Select(i => Utility.SpriteAnimationFromParams(idleFPS, sprites[i * 2], sprites[i * 2 + 1])).ToList());
            var moveAnimationSet     = new AnimationSet("move", directionalSelector, Enumerable.Range(0, 8).Select(i => Utility.SpriteAnimationFromParams(idleFPS, sprites[i * 2], sprites[i * 2 + 1])).ToList());
            var fullDashAnimationSet = new AnimationSet("fullDash", directionalSelector, Enumerable.Range(0, 8).Select(i => Utility.SpriteAnimationFromParams(dashFPS, sprites[16 + i], sprites[24 + i], sprites[32 + i])).ToList());

            setAnimator.AddAnimationSet(idleAnimationSet).AddAnimationSet(moveAnimationSet).AddAnimationSet(fullDashAnimationSet);
        }
Пример #3
0
 public void PlaySet(string name)
 {
     CurrentAnimationSet  = animationSets[name];
     switchedAnimationSet = true;
 }