Sequence.facing idea/RFC.

This commit is contained in:
Bob
2010-02-11 12:20:06 +13:00
parent f1db8c6f07
commit 62198067d6
5 changed files with 33 additions and 21 deletions

View File

@@ -40,12 +40,10 @@ namespace OpenRa.Traits.Activities
!self.World.Map.Harvest(self.Location, out isGem))
return false;
var harvestAnim = "harvest" + Util.QuantizeFacing(unit.Facing, 8);
if (harvestAnim != renderUnit.anim.CurrentSequence.Name)
if (renderUnit.anim.CurrentSequence.Name != "harvest")
{
isHarvesting = true;
renderUnit.PlayCustomAnimation(self, harvestAnim, () => isHarvesting = false);
renderUnit.PlayCustomAnimation(self, "harvest", () => isHarvesting = false);
}
harv.AcceptResource(isGem);
return true;

View File

@@ -15,6 +15,7 @@ namespace OpenRa.Traits
public RenderUnit(Actor self)
: base(self)
{
anim = new Animation( GetImage( self ), () => self.traits.Get<Unit>().Facing );
PlayFacingAnim(self);
anims.Add( "smoke", new AnimationWithOffset( new Animation( "smoke_m" ), null, () => !isSmoking ) );