Some minor issues in the code

  1. if (_colorChanger) { _colorChanger.SetColor( part should be outside of the foreach (SpriteRenderer sr in _spriteRenderers) loop, as we only have one per enemy.

  2. SetRandomColor could probably call SetDefaultColor instead of assigning and updating color manually, to avoid repeated code.

Privacy & Terms