Here is another simple example of how you game manager could be implemented with use of
DontDestroyOnLoad() and additional
isActive() method if it derives from MonoBehaviour.

I previous post we it was explained how we can implement singleton pattern and persist its instance after reloading the scene. Now lets have a look at how we could take advantage of extending MonoBehaviour class and using
DontDestroyOnLoad() method.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

publicclassGameManager:MonoBehaviour{

staticGameManager _instance;

staticpublicboolisActive{

get{

return_instance!=null;

}

}

staticpublicGameManagerinstance

{

get

{

if(_instance==null)

{

_instance=Object.FindObjectOfType(typeof(GameManager))asGameManager;

if(_instance==null)

{

GameObject go=newGameObject("_gamemanager");

DontDestroyOnLoad(go);

_instance=go.AddComponent<GameManager>();

}

}

return_instance;

}

}

}

Example shown in previous post provides easy access to all public properties and methods of GameManager singleton retrieved via
GameManager.instance property. This example however takes it to the next level, as you can now add public properties which you can modify directly from within Unity3d Editor.