multiple EventSystems
Hi,
I have a main menu with an animated background as well as a sub menu without camera. Since I want to be able to call my sub menu from inside different levels as well, i decided to use scenes for both menus and load the submenu additive to keep the background/level going (when coming from the main menu, I use SetActive to deactivate the main menu buttons and only have the background together with the sub menu).
Both loading the sub menu from the main menu as well as from the game works as intended like this, but every time i call the sub menu up from the menu, I get the warning that i have 2 event systems open. Using SetActive to activate/deactivate the EventSystem always makes the buttons unusable on reactivate and while not using an EventSystem on the sub menu works when opening it from the main menu, I'd be missing it when loading it from the levels, so that's not really an option.
Is there a better way to go about this issue? Do I even have to care about it? From my understanding, 2 open EventSystems might make a problem if you customize them differently, so it might access the wrong one, but as long as they are the same, it shouldn't matter if 1 or 2 are open, right?
Thanks!
Edit: nvm, putting the EventSystem into the Canvas with the Buttons, which gets disabled by SetActive on loading another scene kept the buttons working. No idea though, why it didnt work when i was setting the EventSystem active/inactive on it's own, seemed like the buttons would lose their connection to it like that.
As a sidenote, Scene$$anonymous$$anagement.sceneCount worked great as condition to disable the interface.
Your answer
Follow this Question
Related Questions
ReEnable mouse(movement,selection,etc) after loading game menu 1 Answer
Cant click on GamObject 1 Answer
How to call a public function automatically when I return to the Main Menu from any levels? 3 Answers
How do I add my script to the "Assets/Create" menu? 2 Answers
UnityEngine.Application.LoadLevel(String) is obsolet! 1 Answer