/// <summary> /// Main update loop for loading saves. Called every frame after somebody hits the load button /// until the Status is set back to Loaded /// </summary> /// <returns>True if the save is still being loaded, or false if we're done</returns> public static bool Load() { if (!savesInitialized) { InitializeSaveStates(); } SaveState state = saves.GetState(saveSlot); if (state != null) { switch (status) { case Status.Loaded: Map.Fade = 1f; if (state.SavedInHub) { Map.LoadHub(Map.Outcomes.ExitLevel); } else { Map.Level = state.Level; Map.RestartLevelFromMenu(); } status = Status.Loading; break; case Status.Loading: if (Map.Ready && Map.StartRoomReady) { foreach (Room room in Map.Rooms) { if (room.CoordVec.Equals(state.RoomCoords)) { LoadRoom(state, room); LoadCollectables(state, room); LoadTimer(); LoadDestroyedEnemies(state, room); Upgrades.Load(state.Upgrades); status = Status.Loaded; } } } break; } } return(status != Status.Loaded); }