Introduce INotifyAttack.PreparingAttack

And use it to allow triggering attack animations/overlays at a different point
than the actual weapon firing.
This commit is contained in:
reaperrr
2016-06-10 17:40:50 +02:00
parent 87537d9669
commit 75c49620d1
12 changed files with 40 additions and 10 deletions

View File

@@ -75,7 +75,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel)
{
if (a == null)
return;
@@ -94,6 +94,8 @@ namespace OpenRA.Mods.Common.Traits.Render
anims[barrel].Animation.PlayThen(sequence, () => visible[barrel] = false);
}
void INotifyAttack.PreparingAttack(Actor self, Target target, Armament a, Barrel barrel) { }
public IEnumerable<IRenderable> Render(Actor self, WorldRenderer wr)
{
foreach (var arm in armaments)