Usually when I deal with my menu choices that are suppose to show a new GameObject it looks something like this:
public void ShowNewClientsPanel()
{
ClientMenuPanel.SetActive(false);
CurrentClientsPanel.SetActive(false);
NewClientsPanel.SetActive(true);
}
Done it in other ways of course, but it’s not a ideal situation.
Any suggestions on what I could do?
I only want to show 1 GameObject Menu at a time, so rest should be set inactive. Like a Toggle, if one is active, rest should be inactive.
Also done a list, where I loop through and active the one that is correct and deactive rest. It just feels off… like it could be better - so I thought I would ask.
Once again I’ll pimp my Datasacks package. Specifically for the problem above, I have a DSGameObjectControl script that can either operate as a boolean for simple things, or else operate as a list, where the underlying data value controls which item in the list is ON, and the rest are turned OFF.
This graphic kinda lays it out, and there are lots of other examples in the project: