Skip to content

Commit ad659bc

Browse files
committed
Fixed ship trail reset
1 parent 12de61d commit ad659bc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Assets/Script/Gameplay/ShipBehavior.cs

+6
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ void UpdateVolume(bool engineIsOn) {
173173
}
174174

175175
IEnumerator Enter(bool clearScreen = false) {
176+
177+
ClearTrails ();
176178

177179
if (clearScreen) {
178180
var megaExplosion = MegaExplosionPool.GetObject ();
@@ -188,6 +190,7 @@ IEnumerator Enter(bool clearScreen = false) {
188190

189191
VoidHit.HitAll ();
190192

193+
ClearTrails ();
191194
FireParticle.Clear ();
192195
FireParticle.Play ();
193196

@@ -326,7 +329,10 @@ public void ReceiveNewLife() {
326329
public void ClearTrails() {
327330

328331
for (var i = 0; i < WingTrails.Count; i++) {
332+
// not sure why disabling/re-enabling is needed after Unity update
333+
WingTrails [i].enabled = false;
329334
WingTrails [i].Clear ();
335+
WingTrails [i].enabled = true;
330336
}
331337

332338
}

0 commit comments

Comments
 (0)