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:
@@ -47,13 +47,15 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
wsb = init.Self.Trait<WithSpriteBody>();
|
||||
}
|
||||
|
||||
public void Attacking(Actor self, Target target, Armament a, Barrel barrel)
|
||||
void INotifyAttack.Attacking(Actor self, Target target, Armament a, Barrel barrel) { }
|
||||
|
||||
void INotifyAttack.PreparingAttack(Actor self, Target target, Armament a, Barrel barrel)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(info.AttackSequence))
|
||||
wsb.PlayCustomAnimation(self, info.AttackSequence, () => wsb.CancelCustomAnimation(self));
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
void ITick.Tick(Actor self)
|
||||
{
|
||||
if (string.IsNullOrEmpty(info.AimSequence) && string.IsNullOrEmpty(info.ReloadPrefix))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user