Facing -> new trait ("Unit")

This commit is contained in:
Bob
2009-11-25 18:11:44 +13:00
parent 7ccb2aa9ee
commit 2aea110497
21 changed files with 120 additions and 87 deletions

View File

@@ -18,12 +18,11 @@ namespace OpenRa.Game.Traits
void PlayFacingAnim(Actor self)
{
var mobile = self.traits.GetOrDefault<Mobile>();
var heli = self.traits.GetOrDefault<Helicopter>();
var unit = self.traits.Get<Unit>();
anim.PlayFetchIndex("idle",
() => Util.QuantizeFacing(
mobile != null ? mobile.facing : heli.facing,
unit.Facing,
anim.CurrentSequence.Length ));
}