Skip to content

Commit

Permalink
Simplify SetActiveRenderer logic
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgraham committed May 7, 2022
1 parent 111a3b6 commit 4a7b146
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Assets/Scripts/Explosion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ public class Explosion : MonoBehaviour

public void SetActiveRenderer(AnimatedSpriteRenderer renderer)
{
start.enabled = false;
middle.enabled = false;
end.enabled = false;

renderer.enabled = true;
start.enabled = renderer == start;
middle.enabled = renderer == middle;
end.enabled = renderer == end;
}

public void SetDirection(Vector2 direction)
Expand Down

0 comments on commit 4a7b146

Please sign in to comment.