Skip to content

Commit

Permalink
Fixed ship trail reset
Browse files Browse the repository at this point in the history
  • Loading branch information
bassarisse committed Oct 4, 2018
1 parent 12de61d commit ad659bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Assets/Script/Gameplay/ShipBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ internal enum ShipState {
}

IEnumerator Enter(bool clearScreen = false) {

ClearTrails ();

if (clearScreen) {
var megaExplosion = MegaExplosionPool.GetObject ();
Expand All @@ -188,6 +190,7 @@ internal enum ShipState {

VoidHit.HitAll ();

ClearTrails ();
FireParticle.Clear ();
FireParticle.Play ();

Expand Down Expand Up @@ -326,7 +329,10 @@ internal enum ShipState {
public void ClearTrails() {

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

}
Expand Down

0 comments on commit ad659bc

Please sign in to comment.