public void AddAnimation(string animationName, Texture2D animationTexture, int frameWidth, int frameHeight, int frameCount, int frametime, Color color, float scale, bool looping, bool setActive = false, bool tieToTempo = false) { Animation newAnimation = new Animation(); newAnimation.Initialize(this, animationTexture, frameWidth, frameHeight, frameCount, frametime, color, scale, looping, tieToTempo); newAnimation.Active = setActive; animations.Add(animationName, newAnimation); if(setActive) PlayAnimation(animationName); }
public void PlayAnimation(string animationName) { if (animations.TryGetValue(animationName, out activeAnimation)) { activeAnimation.Active = true; } else { activeAnimation = null; } }