public void Init(int slot) { mExists = UserSlotData.IsSlotExist(slot); if (mExists) { infoGO.SetActive(true); deleteGO.SetActive(true); newGO.SetActive(false); switch (SlotInfo.GetGameMode(slot)) { case SlotInfo.GameMode.Hardcore: portrait.spriteName = SlotInfo.IsDead(slot) ? portraitDead : portraitHardcore; break; default: portrait.spriteName = portraitNormal; break; } for (int i = 0; i < weapons.Length; i++) { weapons[i].SetActive(SlotInfo.WeaponIsUnlock(slot, i + 1)); } heartsLabel.text = "x" + SlotInfo.GetHeartCount(slot); int tankCount = 0; if (SlotInfo.IsSubTankEnergy1Acquired(slot)) { tankCount++; } if (SlotInfo.IsSubTankEnergy2Acquired(slot)) { tankCount++; } eTankLabel.text = "x" + tankCount; tankCount = 0; if (SlotInfo.IsSubTankWeapon1Acquired(slot)) { tankCount++; } if (SlotInfo.IsSubTankWeapon2Acquired(slot)) { tankCount++; } wTankLabel.text = "x" + tankCount; armor.color = SlotInfo.IsArmorAcquired(slot) ? Color.white : Color.black; clearTimeLabel.text = "CLEAR TIME: " + SlotInfo.GetClearTimeString(slot); } else { infoGO.SetActive(false); deleteGO.SetActive(false); newGO.SetActive(true); } }
void OnInfoClick(GameObject go) { int slot = GetSlot(go); if (slot != -1) { mSelectedSlot = slot; if (SlotInfo.IsDead(slot)) { UIModalConfirm.Open(GameLocalize.GetText("dead_confirm_title"), GameLocalize.GetText("dead_confirm_desc"), delegate(bool yes) { if (yes) { SlotInfo.DeleteData(slot); UserSlotData.DeleteSlot(slot); SlotInfo.CreateSlot(ModalSaveSlots.selectedSlot, SlotInfo.GameMode.Hardcore); SceneState.instance.ResetGlobalValues(); SceneState.instance.ResetValues(); AchievementFixRetroActive(); Main.instance.sceneManager.LoadScene(Scenes.levelSelect); } }); } else { UserSlotData.LoadSlot(slot, true); SlotInfo.LoadCurrentSlotData(); SceneState.instance.ResetGlobalValues(); SceneState.instance.ResetValues(); AchievementFixRetroActive(); Main.instance.sceneManager.LoadScene(Scenes.levelSelect); } } }