Replace INotifyBuildComplete in render traits with conditions.

This commit is contained in:
Paul Chote
2018-10-05 20:16:36 +00:00
committed by abcdefg30
parent 26b0a06a17
commit 14607f55c5
28 changed files with 152 additions and 407 deletions

View File

@@ -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);
}