void Awake() { instance = this; statusBarUI.Initialize(); }
public void LoadGame() { #if UNITY_EDITOR && ODIN_SUPPORTED // Specific so game won't save/load for Lyrcaxis if (!UnityEditor.EditorPrefs.GetBool("ShouldGameSave", true)) { Debug.Log("Not Loading :)"); return; } #endif if (CurrentSaveData != null) { PlayTime = CurrentSaveData.RealPlayTime; GameLibOfMethods.player.transform.localPosition = new Vector3(CurrentSaveData.playerX, CurrentSaveData.playerY, 1); GameTime.Clock.SetTime(CurrentSaveData.time); GameTime.Calendar.Initialize(CurrentSaveData.days, CurrentSaveData.weekday, CurrentSaveData.season); Weather.WeatherSystem.Initialize(CurrentSaveData.weather); Stats.SetMoney = CurrentSaveData.money; Bank.Instance.MoneyInBank = (float)CurrentSaveData.moneyInBank; Bank.Instance.PercentagePerDay = CurrentSaveData.percentagePerDay; Bank.Instance.UpdateBalance(); Stats.XpMultiplier = CurrentSaveData.xpMultiplayer; Stats.PriceMultiplier = CurrentSaveData.priceMultiplayer; Stats.RepairSpeed = CurrentSaveData.repairSpeed; SpriteControler.Instance.visuals = CurrentSaveData.characterVisuals.GetVisuals(); Inventory.Initialize(CurrentSaveData.inventoryItems, CurrentSaveData.containerItems); JobManager.JobData = CurrentSaveData.job; Stats.Initialize(CurrentSaveData.playerSkillsData, CurrentSaveData.playerStatusData); if (CurrentSaveData.CompletedMissions != null) { MissionHandler.CompletedMissions = new List <string>(CurrentSaveData.CompletedMissions); } if (CurrentSaveData.CurrentMissions != null) { MissionHandler.CurrentMissions = new List <string>(CurrentSaveData.CurrentMissions); } MissionHandler.missionHandler.ReactivateOld(); //henrique - working on the save system //Debug.LogWarning("Upgrades not loading."); //Upgrades.SetData(CurrentSaveData.upgrades); if (CurrentSaveData.upgrades != null) { StartCoroutine(LoadUpgrades(CurrentSaveData)); } HomePCInteractions.instance.savedProgress = CurrentSaveData.computerActivitiesProgress; CookingHandler.SetCookedRecipes(CurrentSaveData.cookedRecipes); CareerUi.Instance.UpdateJobUi(); } else if (Stats.Ready) //Loaded directly from game scene { Stats.Initialize(); Inventory.Initialize(); CookingHandler.SetCookedRecipes(null); CareerUi.Instance.UpdateJobUi(); } onPlay = true; StatusUIUpdater.UpdateEverything(); }