When we have Ui elements such as Container->Inventory we want to hide them in order when pressing e.g. esc. First hide Container then Inventory. After that, pressing esc should instead toggle main menu.
For that consider z-level ordering of the CanvasElements. First hide highest ones, then lowest ones. We should definitely avoid ray casts.
Remember to adjust code that adds elements to "stack" them on the highest layer.
When we have Ui elements such as Container->Inventory we want to hide them in order when pressing e.g.
esc
. First hide Container then Inventory. After that, pressingesc
should instead toggle main menu.For that consider z-level ordering of the
CanvasElement
s. First hide highest ones, then lowest ones. We should definitely avoid ray casts.Remember to adjust code that adds elements to "stack" them on the highest layer.