public void updateFortunes() { FortuneManager.updateAvailableFortunes(); updateFortuneInfo(); updateFortuneContainerSize(); updatePlayerExperience(); updateKeyboardNavigation(); }
void checkIfMarkShopAsNew() { FortuneManager.updateAvailableFortunes(); if (FortuneManager.checkIfAnyFortuneIsNew()) { shopTr.GetChild(1).gameObject.SetActive(true); } }
void resetPlayerValues() { Player.deck = null; Player.collection = null; HubControl.maxUnlockedDifficultyId = 0; HubControl.currentDifficultyId = 0; Player.experience = 0; FortuneManager.restartAllFortunes(); }
void updateFortuneContainerSize() { // 20 from top plus (fortuneHeight + 10 of spacing) for each fortune plus 20 from lower area int nOfFortunes = FortuneManager.getNOfAvailableFortunes(); float ySize = 20 + (FORTUNE_HEIGHT + 10) * nOfFortunes + 20; if (ySize < 600) { ySize = 600; // Minimum size } fortuneContainer.sizeDelta = new Vector2(fortuneContainer.sizeDelta.x, ySize); }
static void applySavegameDataToPlayer(SavegameData save) { //Player.saveVersion = save.saveVersion; // Don't overwrite save version! Player.keyboardModeOn = save.keyboardModeOn; Player.deck = new Deck(save.deckCards); Player.collection = save.collection; HubControl.maxUnlockedDifficultyId = save.maxUnlockedDifficultyId; HubControl.currentDifficultyId = save.currentDifficultyId; Player.experience = save.playerExpDouble; FortuneManager.allFortunes = save.allFortunes; FortuneManager.applyAllFortuneEffects(); Player.stats = save.statsDouble; AudioManager.globlalMute = save.globalMute; Dice.skipAnim = save.skipAnim; BattleManager.skipEnemyDialogue = save.skipEnemyDialogue; Player.checkForUpdatesOnStart = save.checkForUpdatesOnStart; TextScript.language = save.language; Player.rerollPoints = save.rerollPoints; if (Player.isOlderSaveThan(save.saveVersion, "1.1.0")) { // After v1.0.0, Player.stats went from Dictionary<Stat, float> to Dictionary<Stat, double> Player.stats = new Dictionary <Player.Stat, double>(); foreach (Player.Stat stat in save.stats.Keys) { Player.stats.Add(stat, save.stats[stat]); } // After v1.0.0, the "Greatest Rank" stat was added Player.stats.Add(Player.Stat.GREATEST_RANK, HubControl.maxUnlockedDifficultyId); // After v1.0.0, experience went from int to double Player.experience = save.playerExp; // Reset fortunes, and give the player their EXP back FortuneManager.restartAllFortunes(); Player.experience += Player.stats[Player.Stat.TOTAL_EXP_SPENT]; } if (Player.isOlderSaveThan(save.saveVersion, "1.1.3")) { // v1.1.3 added option to check for updates. Default to true Player.checkForUpdatesOnStart = true; } if (Player.isOlderSaveThan(save.saveVersion, "1.1.4")) { // v1.1.4 added stats for "Silver defeated" and "Gold defeated" Player.stats.Add(Player.Stat.SILVER_DEFEATED, 0); Player.stats.Add(Player.Stat.GOLD_DEFEATED, 0); } }
public static void deleteSaveFile() { string savegamePath = Application.persistentDataPath + "/RandomNumberGodSavefile.dat"; if (File.Exists(savegamePath)) { File.Delete(savegamePath); Player.deck = null; Player.collection = null; HubControl.maxUnlockedDifficultyId = 0; HubControl.currentDifficultyId = 0; Player.experience = 0; Player.stats = null; Player.rerollPoints = 0; FortuneManager.restartAllFortunes(); SceneManager.LoadScene("TitleScreen"); } }
public void returnToHub() { FortuneManager.markAllFortunesAsSeen(); Savegame.save(); SceneManager.LoadScene("Hub"); }