Canvas.renderOrder
I'm building ui system which relies on canvases sorting order for making them interactable or not. I'm perfectly fine with out of the box hierarchy sorting, and try to use that Canvas.renderOrder property to determine which overlay canvas is on top, but its values seem to make no sense. Consider the scene:
Each canvas has following script attached:
public class DisplayRenderOrder : MonoBehaviour
{
public int renderOrder;
public Canvas canvas;
void Update()
{
renderOrder = canvas.renderOrder;
}
}
What i expect to see in renderOrder field is 0, 1, 2, 3, 4 for respective canvases from top to bottom. What i actually see is root canvas having render order 0 and other canvases having order 1.
So what exactly is stored in Canvas.renderOrder property? Is there some other way for two given canvases to determine which one will be rendered on top (regardless to sorting overrides)?
Your answer
Follow this Question
Related Questions
UI ScrollRect is bouncing back to Origin 2 Answers
Card array layout 1 Answer
Use a canvas prefab multiple times at the same time 0 Answers
View individual Rect boxes when multiple UI elements are selected? 0 Answers
How to forbid float sizes and positions of all UI elements of UGUI while editing? 1 Answer