Search Unity

"Complex" UI architecture & navigations problems : What is the best way

Discussion in 'UGUI & TextMesh Pro' started by Saaranir, Mar 20, 2019.

  1. Saaranir

    Saaranir

    Joined:
    Nov 13, 2018
    Posts:
    1
    Hello,

    I'm working on a game mostly based on UI, where the player can navigate through the menus. There is different type of menus, some of which can go "deeper".

    For example 3 menus : One for trading, one for war, and one for city management. In the trading menu, there are smaller menus for improving shops, or other things.

    My problems come from those. I don't know the best way to properly "close" all the smaller menus and return to the original state of the trading menu, if i quit it.

    An example of my problem : Player click the trading menu, then open the sub menu "shop", then open the list of the ressources, click on one to have details of that ressource. Then player click on another main menu, war for example. If after going to war menu, he click the trading menu again, all the smaller menu will still be open. And the menu won't be in his original state.

    I managed to fix the problem by having a function that check all sub menus in trading, and set them inactive, and also do that for the child menus of the those sub menus, and over again (I can have 5 row of sub menus).

    But it just feels so wrong, i'm not happy with this solution. I feel like i'm doing this in brute force, and also that it's a poor solution on larger scale.

    I was wondering if any of you had encountered this kind of situations before, and how you managed it ? Or just if you have any idea of how i could do that better. That would be really nice.

    Thanks