void OnEnable() { if (!menuScene) { Enemies = enemies; LoadingNewLevel = false; LevelManager.InitializeLevelManager(uiParent, roomSpawner, player.transform); roomSpawner.SpawnRooms(); uiParent.InitializeUI(); uiParent.StartFadeBlind(1f, 0f, 2f, true); } }
public static IEnumerator <WaitForSeconds> ResetLevel(float time) { uiParent.StartFadeBlind(0f, 1f, time, false); // Cover up camera yield return(new WaitForSeconds(time)); roomSpawner.Reset(); roomSpawner.SpawnRooms(); player.position = Vector3.zero; playerPC.CurrentHitPoints = playerPC.MaxHitPoints; // Reload all gunz yield return(new WaitForSeconds(1f)); // Used to cover up the camera moving across the level uiParent.StartFadeBlind(1f, 0f, time, true); // Uncover camera yield return(new WaitForSeconds(time)); DungeonGameManager.LoadingNewLevel = false; }