Closed takaaptech closed 7 years ago
Thanks, I'm glad you find it useful :)
Well, the stack is there so that you can go back in the menu ( think of it like the browser's back button ) and also it's for the manager to keep track of what's open. In your situation, keeping the stack won't give you any advantage, so here's my advice:
Hide()
the GameOver screen and MainGame will appear by itself again ( because it's in the stack ).The stack shouldn't have any serious performance impacts since the screens are reused, but the fact that it's filling up is most probably because you're not closing your screens, instead you're opening new ones on top of older ones. You can also use HideAll()
, which will clear the stack and close all screens.
Hope it helps !
Hi @Xerios, I see Hide() very helpful in my case, after test, i see another problem (just in my case, not the lib): In Game Over, I have a button that can go back to home (Main Menu), also has Retry button to go back to InGame. In Menu we have Play button to go direct to InGame. In Retry button (Game Over) i try using Hide() function. So if we have chain like this: Menu -> InGame -> GameOver - > Menu -> Ingame -> GameOver -> this time press Retry will show GameOver again. So maybe if from GameOver we can go to both Menu and Ingame, then we should use show instead?
I'll be uploading new functionality and a demo that will cover your case, really soon :)
Opp! Sorry for delay closing it. I tested and it works as expected! Thank so much!
First of all, i think it is the simple and awesome solution! Thank so much for this lib! My game have 3 screens: Menu, MainGame, GameOver and i using screenmgr.Show("SceneName") for changing between screens. When user plays a lot, i see on editor the Stack contains many screens. Is this problem for memory or GC? Is there any way to reduce stack in this case or this design is for some purpose? Thank so much!