Replace INotifyBuildComplete in render traits with conditions.
This commit is contained in:
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
void UpdateState(Actor self)
|
||||
{
|
||||
if (renderOpen)
|
||||
if (renderOpen || IsTraitPaused)
|
||||
DefaultAnimation.PlayRepeating(NormalizeSequence(self, gateBodyInfo.OpenSequence));
|
||||
else
|
||||
DefaultAnimation.PlayFetchIndex(NormalizeSequence(self, Info.Sequence), GetGateFrame);
|
||||
@@ -91,8 +91,10 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
UpdateState(self);
|
||||
}
|
||||
|
||||
protected override void OnBuildComplete(Actor self)
|
||||
protected override void TraitEnabled(Actor self)
|
||||
{
|
||||
base.TraitEnabled(self);
|
||||
|
||||
UpdateState(self);
|
||||
UpdateNeighbours(self);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user