예제 #1
0
        /// <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);
            }
        }
예제 #2
0
        /// <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);
            }
        }
예제 #3
0
        /// <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);
            }
        }
예제 #4
0
        //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);
            }
        }
예제 #5
0
        public override void LoadFromFile()
        {
            string path = $"{FOLDER_PATH}/{nameof(DoOnceTask)}/{name}";

            if (GameFileSystem.LoadFromFile(path, out bool outValue))
            {
                isDoneOnce = outValue;
            }
        }
예제 #6
0
        /// <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);
            }
        }
예제 #7
0
        public void LoadProgressionFromFile()
        {
            string path = $"{FOLDER_PATH}/{name}";

            if (GameFileSystem.LoadFromFile(path, out Progression progress))
            {
                progression.Override(progress);
            }
        }
예제 #8
0
        public override void LoadFromFile()
        {
            string path = $"{FOLDER_PATH}/{nameof(IncrementTask)}/{name}";

            if (GameFileSystem.LoadFromFile(path, out int outValue))
            {
                count = outValue;
            }
        }
예제 #9
0
        /// <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);
            }
        }
예제 #10
0
        public override void LoadFromFile()
        {
            string path = $"{FOLDER_PATH}/{nameof(MinimalValueTask)}/{name}";

            if (GameFileSystem.LoadFromFile(path, out float outValue))
            {
                currentValue = outValue;
            }
        }
예제 #11
0
        /// <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);
            }
        }
예제 #12
0
 /// <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();
     }
 }
예제 #13
0
        /// <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);
            }
        }
예제 #14
0
        /// <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);
            }
        }
예제 #15
0
        /// <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);
            }
        }
예제 #18
0
    /// <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();
        }
    }
예제 #19
0
        /// <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);
            }
        }
예제 #20
0
        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;
                }
            }
        }
예제 #21
0
        /// <summary>Saves value to local storage</summary>
        protected override void SaveToFile()
        {
            string path = $"{FOLDER_NAME}/{nameof(BankAppointmentType)}/{name}";

            GameFileSystem.SaveToFile(path, appointment);
        }
예제 #22
0
    /// <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);
    }
예제 #23
0
        /// <summary>Saves value to local storage</summary>
        protected override void SaveToFile()
        {
            string path = $"{FOLDER_NAME}/{nameof(GroceryProperty)}/{name}";

            GameFileSystem.SaveToFile(path, groceries);
        }
예제 #24
0
        /// <summary>Saves value to local storage</summary>
        protected override void SaveToFile()
        {
            string path = $"{FOLDER_NAME}/{nameof(PlayerMailProperty)}/{name}";

            GameFileSystem.SaveToFile(path, mailList);
        }
예제 #25
0
        public override void SaveToFile()
        {
            string path = $"{FOLDER_PATH}/{nameof(MinimalValueTask)}/{name}";

            GameFileSystem.SaveToFile(path, currentValue);
        }
예제 #26
0
        private void SaveProgressionToFile()
        {
            string path = $"{FOLDER_PATH}/{name}";

            GameFileSystem.SaveToFile(path, progression);
        }
예제 #27
0
        /// <summary>Saves value to local storage</summary>
        protected override void SaveToFile()
        {
            string path = $"{FOLDER_NAME}/{nameof(PlayerGender)}/{name}";

            GameFileSystem.SaveToFile(path, gender);
        }
예제 #28
0
        public override void SaveToFile()
        {
            string path = $"{FOLDER_PATH}/{nameof(IncrementTask)}/{name}";

            GameFileSystem.SaveToFile(path, count);
        }
예제 #29
0
        /// <summary>Saves value to local storage</summary>
        protected override void SaveToFile()
        {
            string path = $"{FOLDER_NAME}/{nameof(TamagotchiElementProperty)}/{name}";

            GameFileSystem.SaveToFile(path, percentage);
        }
예제 #30
0
        /// <summary>Saves value to local storage</summary>
        protected override void SaveToFile()
        {
            string path = $"{FOLDER_NAME}/{nameof(DigiDProperty)}/{name}";

            GameFileSystem.SaveToFile(path, accountValue);
        }