Change animations to use the proper SequenceProvider

Remove references to the global "Game" and use the SequenceProvider
of the current world/map.
This commit is contained in:
Pavlos Touboulidis
2014-05-11 03:05:47 +03:00
parent 6eabc6adf5
commit b560268495
52 changed files with 132 additions and 117 deletions

View File

@@ -16,27 +16,29 @@ namespace OpenRA.Mods.RA.Effects
{
class GpsSatellite : IEffect
{
WPos Pos;
Animation Anim = new Animation("sputnik");
WPos pos;
readonly Animation anim;
public GpsSatellite(WPos pos)
public GpsSatellite(World world, WPos pos)
{
Pos = pos;
Anim.PlayRepeating("idle");
this.pos = pos;
anim = new Animation(world, "sputnik");
anim.PlayRepeating("idle");
}
public void Tick( World world )
{
Anim.Tick();
Pos += new WVec(0, 0, 427);
anim.Tick();
pos += new WVec(0, 0, 427);
if (Pos.Z > Pos.Y)
if (pos.Z > pos.Y)
world.AddFrameEndTask(w => w.Remove(this));
}
public IEnumerable<IRenderable> Render(WorldRenderer wr)
{
return Anim.Render(Pos, wr.Palette("effect"));
return anim.Render(pos, wr.Palette("effect"));
}
}
}