コード例 #1
0
ファイル: Renderer.cs プロジェクト: Thunderchen/CavemanRunner
 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);
 }
コード例 #2
0
ファイル: Renderer.cs プロジェクト: Thunderchen/CavemanRunner
 public void PlayAnimation(string animationName)
 {
     if (animations.TryGetValue(animationName, out activeAnimation))
     {
         activeAnimation.Active = true;
     }
     else
     {
         activeAnimation = null;
     }
 }