Function DrawingManager.GetRedrawScope
A scope which can be used to draw things over multiple frames.
RedrawScope GetRedrawScope (
associatedGameObject=null | If not null, the scope will only be drawn if gizmos for the associated GameObject are drawn. This is useful in the unity editor when e.g. opening a prefab in isolation mode, to disable redraw scopes for objects outside the prefab. Has no effect in standalone builds. |
A scope which can be used to draw things over multiple frames.
You can use GetBuilder(RedrawScope,bool) to get a builder with a given redraw scope. Everything drawn using the redraw scope will be drawn every frame until the redraw scope is disposed.
private RedrawScope redrawScope;
void Start () {
redrawScope = DrawingManager.GetRedrawScope();
using (var builder = DrawingManager.GetBuilder(redrawScope)) {
builder.WireSphere(Vector3.zero, 1.0f, Color.red);
}
}
void OnDestroy () {
redrawScope.Dispose();
}