public override void Terminate()
 {
     DrawSystem.RemoveObject(drawObject);
     drawObject = null;
 }
 public DrawComponent(Entity owner, Texture2D texture, Color overlay, Rectangle? sourceRect)
     : base(owner, ComponentType.Draw)
 {
     drawObject = DrawSystem.AddObject(texture, owner.Position, owner.Size, owner.Origin, overlay, sourceRect, owner.Rotation);
 }
 public static void RemoveObject(DrawObject d)
 {
     drawObjects.Remove(d);
 }
 public static DrawObject AddObject(Texture2D texture, Vector2 position, Vector2 origin, Color color, Rectangle? sourceRectangle, float rotation, float scale)
 {
     DrawObject obj = new DrawObject(texture, position, Vector2.Zero, origin, color, sourceRectangle, rotation, scale, true);
     drawObjects.Add(obj);
     return obj;
 }
 public static DrawObject AddObject(Texture2D texture, Vector2 position, Vector2 size, Vector2 origin, Color color, Rectangle? sourceRectangle, float rotation)
 {
     DrawObject obj = new DrawObject(texture, position, size, origin, color, sourceRectangle, rotation, 0, false);
     drawObjects.Add(obj);
     return obj;
 }
 public static void AddObject(DrawObject obj)
 {
     drawObjects.Add(obj);
 }