void OnDisable() { if (_fig != null) { _fig.Dispose(); _fig = null; } }
public void Draw(GLFigure fig) { switch (shape) { case ShapeEnum.Circle: if (fill == FillEnum.Edge) { fig.DrawCircle(transform.position, transform.rotation, transform.localScale, color); } else { fig.FillCircle(transform.position, transform.rotation, transform.localScale, color); } break; case ShapeEnum.Quad: if (fill == FillEnum.Edge) { fig.DrawQuad(transform.position, transform.rotation, transform.localScale, color); } else { fig.FillQuad(transform.position, transform.rotation, transform.localScale, color); } break; case ShapeEnum.Fan: if (fill == FillEnum.Edge) { fig.DrawFan(transform.position, transform.rotation, transform.localScale, color, -30f, 30f); } else { fig.FillFan(transform.position, transform.rotation, transform.localScale, color, -30f, 30f); } break; } }
void OnEnable() { _fig = new GLFigure(); }
void Awake() { _fig = new GLFigure(); }