What I’m doing is draw the camera view range in the minimap, and in the LateUpate() I calculate the rectangle then draw it with Draw.ingame.WireRectangle. it draw the rectangle correctly in the Scene but nothing changed in the Game.
It will show the rectangle in the game now, but it is covered by UI image, how can I show the rectangle on the top of the UI?
Below the code will execute every frame in LateUpdate to draw the rectangle which involves two using() code blocks, can I initialize the inGameCommandBuilder.InScreenSpace and inGameCommandBuilder.WithLineWidth at Start() so that I only call inGameCommandBuilder.WireRectangle at LateUpdate()?
var inGameCommandBuilder = Draw.ingame;
using (inGameCommandBuilder.InScreenSpace(mainCamera))
{
using (inGameCommandBuilder.WithLineWidth(2))
{
Rect rect = new Rect(minX, minY, sizeX, sizeY);
inGameCommandBuilder.WireRectangle(rect, Color.cyan);
}
}