public void CompleteLoadProcess() { Ref.SceneType currentScene = Ref.currentScene; if (currentScene != Ref.SceneType.Build) { if (currentScene == Ref.SceneType.Game) { GameSaving.Quicksaves quicksaves = GameSaving.Quicksaves.LoadQuicksaves(); if (this.selectedSaveId != -1 && this.selectedSaveId < quicksaves.QuicksavesCount) { GameSaving.LoadGame(quicksaves.quicksaves[this.selectedSaveId]); MsgController.ShowMsg("Game Loaded"); this.CloseMenus(); } } } else { Build.BuildQuicksaves buildQuicksaves = Build.BuildQuicksaves.LoadBuildQuicksaves(); if (this.selectedSaveId != -1 && this.selectedSaveId < buildQuicksaves.QuicksavesCount) { Build.main.LoadSave(buildQuicksaves.buildSaves[this.selectedSaveId]); this.CloseMenus(); } } }
private void LoadSaveFilesIcons() { while (this.saveFilesIcons.Count > 0) { UnityEngine.Object.Destroy(this.saveFilesIcons[0].gameObject); this.saveFilesIcons.RemoveAt(0); } bool flag = Ref.inputController.canvasScalers[0].referenceResolution.x == 750f; int num = (!flag) ? 8 : 12; List <string> list = new List <string>(); if (Ref.currentScene == Ref.SceneType.Build) { Build.BuildQuicksaves buildQuicksaves = Build.BuildQuicksaves.LoadBuildQuicksaves(); for (int i = 0; i < Mathf.Min(buildQuicksaves.QuicksavesCount, 24); i++) { list.Add(buildQuicksaves.buildSaves[i].saveName); } } else if (Ref.currentScene == Ref.SceneType.Game) { GameSaving.Quicksaves quicksaves = GameSaving.Quicksaves.LoadQuicksaves(); for (int j = 0; j < Mathf.Min(quicksaves.QuicksavesCount, 24); j++) { list.Add(quicksaves.quicksaves[j].saveName); } } Transform child = this.loadingMenuHolder.transform.GetChild(1); for (int k = 0; k < list.Count; k++) { Transform transform = UnityEngine.Object.Instantiate <Transform>(this.saveFileIconPrefab, child); transform.localPosition = new Vector3((float)(k / num * 365), (float)(k % num * -66), 0f); transform.GetChild(1).GetComponent <Text>().text = list[k]; this.saveFilesIcons.Add(transform.GetComponent <BoxCollider2D>()); } child.localPosition = new Vector3(-182.5f * (float)((list.Count - 1) / num), child.localPosition.y); }