public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth)
{
if (Main.screenPosition.Y > 10000.0)
return;
int num1 = -1;
int num2 = 0;
for (int index = 0; index < _ufos.Length; ++index)
{
float num3 = _ufos[index].Depth;
if (num1 == -1 && num3 < maxDepth)
num1 = index;
if (num3 > minDepth)
num2 = index;
else
break;
}
if (num1 == -1)
return;
Color color = new Color(Main.bgColor.ToVector4() * 0.9f + new Vector4(0.1f));
Vector2 vector2_1 = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1));
Rectangle rectangle = new Rectangle(-1000, -1000, 4000, 4000);
for (int index = num1; index < num2; ++index)
{
Vector2 vector2_2 = new Vector2(1f / _ufos[index].Depth, 0.9f / _ufos[index].Depth);
Vector2 position = _ufos[index].Position;
position = (position - vector2_1) * vector2_2 + vector2_1 - Main.screenPosition;
if (_ufos[index].IsActive && rectangle.Contains((int)position.X, (int)position.Y))
{
spriteBatch.Draw(_ufos[index].Texture, position, new Rectangle?(_ufos[index].GetSourceRectangle()), color * _ufos[index].Opacity, _ufos[index].Rotation,
Vector2.Zero, vector2_2.X * 5f * _ufos[index].Scale, SpriteEffects.None, 0.0f);
if (_ufos[index].GlowTexture != null)
spriteBatch.Draw(_ufos[index].GlowTexture, position, new Rectangle?(_ufos[index].GetSourceRectangle()), Color.White * _ufos[index].Opacity,
_ufos[index].Rotation, Vector2.Zero, vector2_2.X * 5f * _ufos[index].Scale, SpriteEffects.None, 0.0f);
}
}
}