Let's implement the
GameMgr script so that it can manage the loading (and future unloading) of scene files and assets. Implementing this in a flexible way now will make our game more extensible when we have future levels to add. It can be implemented by performing the following steps:
GameMgrand attached it to the
GameGameObject. If you have not already done this, no worries; just create a new script now, and attach it.
GameMgrto do its job, it will act as a mediator between
popupMenuand the scene files of the game. When
GameMgrreceives a message to change its state, it will load and unload the appropriate scene files.