示例#1
0
 public void OnHealthChanged(object sender, HealthChangedEventArgs e)
 {
     int region_idx = (Player.HealthMax - e.HealthWas); // Hard-coded
     int next_idx = region_idx + 1; // Hard-coded
     if (e.HealthWas != e.HealthNow) {
         int step = e.HealthWas > e.HealthNow ? 6 : -6;
         _AnimationCurrent = new SpriteAnimation(Texture, 100, region_idx, region_idx + step,  region_idx + 2 * step, next_idx);
         _AnimationFrameIndex = 0;
         _FrameTimer.Restart ();
     }
 }
示例#2
0
        public void OnHealthChanged(object sender, HealthChangedEventArgs e)
        {
            int region_idx = (Player.HealthMax - e.HealthWas); // Hard-coded
            int next_idx   = region_idx + 1;                   // Hard-coded

            if (e.HealthWas != e.HealthNow)
            {
                int step = e.HealthWas > e.HealthNow ? 6 : -6;
                _AnimationCurrent    = new SpriteAnimation(Texture, 100, region_idx, region_idx + step, region_idx + 2 * step, next_idx);
                _AnimationFrameIndex = 0;
                _FrameTimer.Restart();
            }
        }