void Awake() { DontDestroyOnLoad(gameObject); if (gameInformations == null) { gameInformations = this; } else { Destroy(gameObject); } }
void Awake() { if (gameManager == null) { gameManager = this; } else { Destroy(gameObject); } if (GameInformations.gameInformations == null) { GameObject gameInfos = Instantiate(Resources.Load("GameManagers/Prefabs/LocalGameInformations") as GameObject); gameInformations = gameInfos.transform.GetComponent <GameInformations> (); LoadDefault(); } else { gameInformations = GameInformations.gameInformations; } gameInformations.SpawnLevel(); }