Two scenes with two EventSystems

Hi,

I have a “loader” scene that displays a splash image (canvas, UI image) and loads the “main” scene.
After the “main” scene is loaded (and apparently activated behind the splash screen) the player is requested to press a key (touch screen) to start. This will fade out the splash image and unload the “loader” scene since I don’t need it anymore. This works on a coroutine.

The issue is that both scenes have EventSystem objects for their interactions.
I have a working solution as follows, but I need to confirm it is a good one.

  1. I’ve set the EventSystem component in the “main” scene as disabled by default (in inspector), so I don’t get the warning about 2 EventSystems.
  2. In the “loader” scene, after the “main” scene have loaded, I request the “loader” scene to be unloaded (SceneManager.UnloadScene). This seems to immediately set the EventSystems.current to null.
  3. Just after the unload request, I notify the main scene and enable the EventSystem component from there. This seems to set the EventSystems.current back to a valid value that points to my new object.

As I said, this seems to work, but if you know of any pitfalls with this, please let me know.

The other option would be to have only one EventSystem object and keep the “loader” scene loaded, but destroy all its content, except the EventSystem object, so it can be used by the second scene. Kinda ugly and prevents me to test the “main” scene alone.

Just drop a line with confirmation if good.
Any feedback appreciated.

Thanks!

Just a note in case anyone bumps into this. Both options work, but in the end I gave up on the loading scene since I didn’t need much loading anyway. And I needed to return to the splash screen on occasions.

Anyway, feel free to share your thoughts on using multiple EventSystem instances.