Support attack animation for turrets via new WithTurretedAttackAnimation trait.

This commit is contained in:
Andre Mohren
2017-04-05 10:24:14 +02:00
committed by reaperrr
parent 62a3099215
commit 9b22f0e11a
3 changed files with 126 additions and 0 deletions

View File

@@ -139,6 +139,21 @@ namespace OpenRA.Mods.Common.Traits.Render
Tick(self);
}
public void PlayCustomAnimation(Actor self, string name, Action after = null)
{
DefaultAnimation.PlayThen(NormalizeSequence(self, name), () =>
{
DefaultAnimation.Play(NormalizeSequence(self, Info.Sequence));
if (after != null)
after();
});
}
public void CancelCustomAnimation(Actor self)
{
DefaultAnimation.PlayRepeating(NormalizeSequence(self, Info.Sequence));
}
void INotifyBuildComplete.BuildingComplete(Actor self) { buildComplete = true; }
void INotifySold.Selling(Actor self) { buildComplete = false; }
void INotifySold.Sold(Actor self) { }