- Home /
Dynamic Buttons, SciptableObjects and Lists
I'm new to Unity and having a problem with what seems should be a pretty basic idea.
Here's what I want to do:
Present the player with a set of buttons. Each button is associated with a scriptableobject with a good amount of data in it, including a reference to the next set of buttons that should be created. The player selects a button ("Archetype"), that selection is stored and the next set of buttons is read in. All the other buttons are removed and a new set of buttons ("ArchetypeSubType") are presented. This process continues until all the sub-menus are finished.
I've been searching for a tutorial that could walk me through a similar process, but haven't had much luck. Does anyone know of such or tutorial and could point me toward it? Alternatively, walking through the process in this thread would work, but it seems like a lot to ask of volunteers.
Answer by tormentoarmagedoom · Feb 23, 2018 at 09:28 AM
Good day!
I'm not sure if i get what you want. As i understand, you want to show some buttons, each button bring you to a new set of buttons (like a tree tech). If you want to do this, you have 2 options:
-Option A: 1 global canvas with buttons that change its properties and components(scripts) when user click a button - Option B: 1 canvas for each "menu" where every button only works for a specific function.
In option A, you only need to create a "menu controller script" that change all buttons components and fucntions when the user goes through the menues.
In option B, you only need to create a "canvas controller" that open/close the correct canvas when user goes through the menu.
I prefear option A , but option B need less scripting... You decide! :D
Ask anything elese you need!
Accept the answer if it heped :D
You have the right idea. Option A is what I've been trying to do. Do you know of a tutorial or even a good example of a "menu control script" that I can dissect and learn from?