public void Initialize() { GameObject gameObject1 = new GameObject(); GameObject gameObject2 = new GameObject(); GameObject gameObject3 = new GameObject(); GameObject gameObject4 = new GameObject(); gameManager = gameObject2.AddComponent <GameManager>(); gameManager.Awake(); enemy = gameObject1.AddComponent <Enemy>(); wall = gameObject3.AddComponent <Wall>(); player = gameObject4.AddComponent <Player>(); gameObject4.tag = "Player"; soundManager = gameObject1.AddComponent <SoundManager>(); lowPitchRange = gameObject1.AddComponent <SoundManager>(); highPitchRange = gameObject1.AddComponent <SoundManager>(); }
static private void OnSceneLoaded(Scene arg0, LoadSceneMode arg1) { instance.level++; instance.Awake(); }