harvester actually sortof works now

This commit is contained in:
Chris Forbes
2009-11-03 19:24:28 +13:00
parent cda22ba7be
commit 1b131465fd
7 changed files with 69 additions and 18 deletions

View File

@@ -12,9 +12,19 @@ namespace OpenRa.Game.Traits
public RenderUnit(Actor self)
: base(self)
{
anim.PlayFetchIndex("idle",
() => self.traits.Get<Mobile>().facing
/ (256/anim.CurrentSequence.Length));
PlayFacingAnim(self);
}
void PlayFacingAnim(Actor self)
{
anim.PlayFetchIndex("idle",
() => self.traits.Get<Mobile>().facing
/ (256 / anim.CurrentSequence.Length));
}
public void PlayCustomAnimation(Actor self, string newAnim, Action after)
{
anim.PlayThen(newAnim, () => { PlayFacingAnim(self); if (after != null) after(); });
}
public override IEnumerable<Pair<Sprite, float2>> Render(Actor self)