/// <summary>Called when the button has been clicked to transition to a new scene</summary> private void OnClick() { TimeController.Instance.BeginTimer(); if (!string.IsNullOrEmpty(nameOfGameScene)) { MusicPlayer.Instance.PlaySFXSound(SFXSound.StartButtonClick); PlayerGenderProperty gender = PlayerPropertyManager.Instance.GetProperty <PlayerGenderProperty>("Gender"); string nameOfScene; if (gender.Value != PlayerGender.NotSelected) { //if a gender has already been selected, try loading the last scene used if (GameFileSystem.LoadFromFile(NavigationSystem.SCENE_SAVE_FILE_PATH, out string loadedSceneName)) { nameOfScene = loadedSceneName; } else { //if no scene could be loaded, set name of scene to be loaded to name of game scene nameOfScene = nameOfGameScene; } playerCharacter.InitFromLocalStorage(); } else { nameOfScene = nameOfCharacterSelectScene; } SceneTransitionSystem.Instance.Transition(nameOfTransition, nameOfScene, loadSceneMode); } }
/// <summary>Loads value from local storage</summary> public override void LoadFromFile() { string path = $"{FOLDER_NAME}/{nameof(PlayerGender)}/{name}"; if (GameFileSystem.LoadFromFile(path, out PlayerGender outValue)) { UpdateGender(outValue, true); } }
/// <summary>Loads value from local storage</summary> public override void LoadFromFile() { string path = $"{FOLDER_NAME}/{nameof(BankAppointmentType)}/{name}"; if (GameFileSystem.LoadFromFile(path, out BankAppointmentType outValue)) { UpdateAppointment(outValue, true); } }
//Loads value from local storage public override void LoadFromFile() { string path = $"{FOLDER_NAME}/{nameof(PlayerRewardProperty)}/{name}"; if (GameFileSystem.LoadFromFile(path, out List <Tuple <string, RewardType> > outValue)) { UpdateReward(outValue, true); } }
public override void LoadFromFile() { string path = $"{FOLDER_PATH}/{nameof(DoOnceTask)}/{name}"; if (GameFileSystem.LoadFromFile(path, out bool outValue)) { isDoneOnce = outValue; } }
/// <summary>Loads value from local storage</summary> public override void LoadFromFile() { string path = $"{FOLDER_NAME}/{nameof(TamagotchiElementProperty)}/{name}"; if (GameFileSystem.LoadFromFile(path, out int outValue)) { UpdateValue(outValue, true); } }
public void LoadProgressionFromFile() { string path = $"{FOLDER_PATH}/{name}"; if (GameFileSystem.LoadFromFile(path, out Progression progress)) { progression.Override(progress); } }
public override void LoadFromFile() { string path = $"{FOLDER_PATH}/{nameof(IncrementTask)}/{name}"; if (GameFileSystem.LoadFromFile(path, out int outValue)) { count = outValue; } }
/// <summary>Loads value from local storage</summary> public override void LoadFromFile() { string path = $"{FOLDER_NAME}/{nameof(GroceryProperty)}/{name}"; if (GameFileSystem.LoadFromFile(path, out List <GroceryType> outValue)) { UpdateGroceries(outValue, true); } }
public override void LoadFromFile() { string path = $"{FOLDER_PATH}/{nameof(MinimalValueTask)}/{name}"; if (GameFileSystem.LoadFromFile(path, out float outValue)) { currentValue = outValue; } }
/// <summary>Loads value from local storage</summary> public override void LoadFromFile() { string path = $"{FOLDER_NAME}/{nameof(PlayerMailProperty)}/{name}"; if (GameFileSystem.LoadFromFile(path, out List <Mail> outValue)) { UpdateMail(outValue, true); } }
/// <summary>Tries loading settings from local storage. Uses max theme and sfx volume as fallback on fail</summary> private void LoadSettings() { if (!GameFileSystem.LoadAsJsonFromFile(SETTINGS_PATH, ref settings)) { settings.ThemeVolume = maxThemeVolume; settings.SFXVolume = maxSFXVolume; SaveSettings(); } }
/// <summary>Loads the active state of this quest from local storage and assigns its value</summary> public void LoadActiveStateFromFile() { string path = $"{FOLDER_PATH}/{name}"; if (GameFileSystem.LoadFromFile(path, out bool outValue)) { SetActive(outValue, true); } }
/// <summary>Loads value from local storage</summary> public void LoadFromFile() { string path = $"{FOLDER_NAME}/{name}"; if (GameFileSystem.LoadFromFile(path, out bool finishedValue)) { SetFinished(finishedValue, false); } }
/// <summary>Loads value from local storage</summary> public override void LoadFromFile() { string path = $"{FOLDER_NAME}/{nameof(DigiDProperty)}/{name}"; if (GameFileSystem.LoadFromFile(path, out bool outValue)) { UpdateAccountValue(outValue, true); } }
//Saves value to local storage protected override void SaveToFile() { string path = $"{FOLDER_NAME}/{nameof(PlayerVolunteerProperty)}/{name}"; GameFileSystem.SaveToFile(path, timesWorked); string path2 = $"{FOLDER_NAME}/{nameof(PlayerVolunteerProperty)}/{name + "nameOfWork"}"; GameFileSystem.SaveToFile(path2, nameOfWork); }
//Loads value from local storage public override void LoadFromFile() { string path = $"{FOLDER_NAME}/{nameof(PlayerVolunteerProperty)}/{name}"; string path2 = $"{FOLDER_NAME}/{nameof(PlayerVolunteerProperty)}/{name + "nameOfWork"}"; if (GameFileSystem.LoadFromFile(path, out int outValue) && GameFileSystem.LoadFromFile(path2, out VolunteerType outValue2)) { UpdateReward(outValue, outValue2, true); } }
/// <summary> Method used to load player money from local storage. </summary> public override void LoadFromFile() { string path = $"{FOLDER_NAME}/Money/{name}"; if (GameFileSystem.LoadFromFile(path, out double savedMoney)) { money = savedMoney; } else { Restore(); } }
/// <summary>Loads the last datetime at which the application closed and initializes the happiness and hunger percentages based on it</summary> private void LoadDateTimeClosed() { if (GameFileSystem.LoadFromFile(FILE_NAME, out long outValue)) { DateTime lastDateTimeClosed = DateTime.FromFileTime(outValue); double seconds = (DateTime.Now - lastDateTimeClosed).TotalSeconds; int happinessPercentageLost = Mathf.RoundToInt((float)seconds * ((float)happiness.Depletion / intervalTime)); happiness.RemoveValue(happinessPercentageLost); int hungerPercentageLost = Mathf.RoundToInt((float)seconds * ((float)hunger.Depletion / intervalTime)); hunger.RemoveValue(hungerPercentageLost); } }
public void InitFromLocalStorage() { string path = $"{PlayerProperty.FOLDER_NAME}/{nameof(PlayerGender)}/{nameOfGenderProperty}"; if (GameFileSystem.LoadFromFile(path, out PlayerGender outValue)) { switch (outValue) { case PlayerGender.NotSelected: Debug.LogWarning("Loaded PlayerGender as not selected :: this is not intended behaviour!"); break; case PlayerGender.Male: SetDisplaySprite(maleSprite); break; case PlayerGender.Female: SetDisplaySprite(femaleSprite); break; } } }
/// <summary>Saves value to local storage</summary> protected override void SaveToFile() { string path = $"{FOLDER_NAME}/{nameof(BankAppointmentType)}/{name}"; GameFileSystem.SaveToFile(path, appointment); }
/// <summary> Method used to save player money to a local storage. </summary> protected override void SaveToFile() { string path = $"{FOLDER_NAME}/Money/{name}"; GameFileSystem.SaveToFile(path, money); }
/// <summary>Saves value to local storage</summary> protected override void SaveToFile() { string path = $"{FOLDER_NAME}/{nameof(GroceryProperty)}/{name}"; GameFileSystem.SaveToFile(path, groceries); }
/// <summary>Saves value to local storage</summary> protected override void SaveToFile() { string path = $"{FOLDER_NAME}/{nameof(PlayerMailProperty)}/{name}"; GameFileSystem.SaveToFile(path, mailList); }
public override void SaveToFile() { string path = $"{FOLDER_PATH}/{nameof(MinimalValueTask)}/{name}"; GameFileSystem.SaveToFile(path, currentValue); }
private void SaveProgressionToFile() { string path = $"{FOLDER_PATH}/{name}"; GameFileSystem.SaveToFile(path, progression); }
/// <summary>Saves value to local storage</summary> protected override void SaveToFile() { string path = $"{FOLDER_NAME}/{nameof(PlayerGender)}/{name}"; GameFileSystem.SaveToFile(path, gender); }
public override void SaveToFile() { string path = $"{FOLDER_PATH}/{nameof(IncrementTask)}/{name}"; GameFileSystem.SaveToFile(path, count); }
/// <summary>Saves value to local storage</summary> protected override void SaveToFile() { string path = $"{FOLDER_NAME}/{nameof(TamagotchiElementProperty)}/{name}"; GameFileSystem.SaveToFile(path, percentage); }
/// <summary>Saves value to local storage</summary> protected override void SaveToFile() { string path = $"{FOLDER_NAME}/{nameof(DigiDProperty)}/{name}"; GameFileSystem.SaveToFile(path, accountValue); }