Merge pull request #9735 from RoosterDragon/animation-refactor

Refactor animation classes
This commit is contained in:
Oliver Brakmann
2015-12-06 18:53:45 +01:00
15 changed files with 67 additions and 71 deletions

View File

@@ -120,7 +120,7 @@ namespace OpenRA.Mods.Common.Effects
if (!string.IsNullOrEmpty(info.Image))
{
anim = new Animation(world, info.Image, GetEffectiveFacing);
anim = new Animation(world, info.Image, new Func<int>(GetEffectiveFacing));
anim.PlayRepeating(info.Sequences.Random(world.SharedRandom));
}

View File

@@ -29,8 +29,7 @@ namespace OpenRA.Mods.Common.Effects
this.building = building;
rb = building.Trait<RepairableBuilding>();
anim = new Animation(building.World, rb.Info.IndicatorImage);
anim.Paused = () => !rb.RepairActive || rb.IsTraitDisabled;
anim = new Animation(building.World, rb.Info.IndicatorImage, () => !rb.RepairActive || rb.IsTraitDisabled);
CycleRepairer();
}