How to make visible/invisible different UI canvas ?

ONLY SOLUTION FOUND: multiple canvas, enable only one at a time:
switch (level)// zero is first, one is second etc…
{
case 1:
level1.SetActive(false);
level2.SetActive(true);
break;
case 2:
level2.SetActive(false);
level3.SetActive(true);
break;
case 3:
level3.SetActive(false);
level4.SetActive(true);
break;
}
Hi all,
Have a multi level game, want the level menu to show right text.
Have a menu with buttons, want to change only cue text on level.
tried many variation of “FindGameObjectWithTag” but it only returns active ones, but I want only one text rendered at a time. If I use layers, will be limited to 23 levels ( 8 for editor + 1 for Light) 32-9, and it’s not elegant.
Maybe with render on/off ? How would you do it ? made many searches and lectures to no avail…stock there.
My hyerachy:
9533704--1345690--upload_2023-12-16_18-4-38.png
Want to activate only one of the Text_Lx at a time…
PS: was easy to change Header text, only a digit, but others are many lines long…

TIA,
regards Robert
2021.3, VR, XR,

Make a public or SerializeField reference and drag the Canvas(es) in you want, operate on them.

Referencing variables, fields, methods (anything non-static) in other script instances:

https://discussions.unity.com/t/833085/2

https://discussions.unity.com/t/839310

It isn’t always the best idea for everything to access everything else all over the place. For instance, it is BAD for the player to reach into an enemy and reduce his health.

Instead there should be a function you call on the enemy to reduce his health. All the same rules apply for the above steps: the function must be public AND you need a reference to the class instance.

That way the enemy (and only the enemy) has code to reduce his health and simultaneously do anything else, such as kill him or make him reel from the impact, and all that code is centralized in one place.