Function CommandBuilder2D.WithColor

WithColor (Color color)

Scope to draw multiple things with the same color.

Public
ScopeColor WithColor (

Color

color

)

Scope to draw multiple things with the same color.

void Update () {
using (Draw.WithColor(Color.red)) {
Draw.Line(new Vector3(0, 0, 0), new Vector3(1, 1, 1));
Draw.Line(new Vector3(0, 0, 0), new Vector3(0, 1, 2));
}
}
Any command that is passed an explicit color parameter will override this color. If another color scope is nested inside this one then that scope will override this color.