I'm working on a tutorial section at the beginning of a game.
I've created Unity UI prefabs that contain a panel with some tutorial text and an OK button.
I've created a new menu which displays the text (as a 'normal' label), and a button, which closes the menu when clicked.
What I'm hoping for is that I can use this one menu to display all the tutorial instructions, and somehow set the label text for each one in an ActionList parameter or something, when turning on the menu.
I've dug around a bit, and I think it could maybe be done with custom tokens, but failing that, it seems I would have to make a new menu for each tutorial section (e.g. Tutorial:Movement, Tutorial:Interactions etc.)
Is there another way to do this that I've missed, or is it expected to create multiple menus for something like this?
I hope I've explained that ok. Let me know if you need more info.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You can do this by having the Label display either a String or PopUp Global Variable, which stores the dynamic text, and then updating that variable's value through Actions.
I'd recommend the use of a PopUp, as you can then control all of the possible values in the same place (i.e. the Variables Manager). Create a new Global PopUp variable, add each of the possible values, then set your Label element's Label type to Global Variable, and point it to this new variable.
You can then use the Variable: Set Action to update this variable value, and - in turn - the text displayed in the Menu.