)
Scope to draw multiple things with an implicit matrix transformation.
All coordinates for items drawn inside the scope will be multiplied by the matrix. If WithMatrix scopes are nested then coordinates are multiplied by all nested matrices in order.
using (Draw.InLocalSpace(transform)) {
// Draw a box at (0,0,0) relative to the current object
// This means it will show up at the object's position
Draw.WireBox(Vector3.zero, Vector3.one);
}
// Equivalent code using the lower level WithMatrix scope
using (Draw.WithMatrix(transform.localToWorldMatrix)) {
Draw.WireBox(Vector3.zero, Vector3.one);
}