コード例 #1
0
    // Start is called before the first frame update
    void Awake()
    {
        DifficultySettingsData difficultySettingsData = new DifficultySettingsData();

        if (settingType == Setting.Column)
        {
            GetComponent <Slider>().value = PlayerPrefs.GetInt(difficultySettingsData.Difficulties.CustomPlayerPref.Col.Name);
        }
        else if (settingType == Setting.row)
        {
            GetComponent <Slider>().value = PlayerPrefs.GetInt(difficultySettingsData.Difficulties.CustomPlayerPref.Row.Name);
        }
    }
コード例 #2
0
    void Start()
    {
        Countdown.onCountdownEnd.AddListener(EnableBoard);
        onGameReset.AddListener(Reset);
        onGameStart.AddListener(StartGame);
        difficultySettingsData = new DifficultySettingsData();
        InitialiseStatPlayerPrefs();
        onGameReset.Invoke();

        customSettingInfo = difficultySettingsData.Difficulties.CustomPlayerPref;
        if (!PlayerPrefs.HasKey(customSettingInfo.Col.Name))
        {
            PlayerPrefs.SetInt(customSettingInfo.Col.Name, customSettingInfo.Col.InitialValue);
        }
        if (!PlayerPrefs.HasKey(customSettingInfo.Row.Name))
        {
            PlayerPrefs.SetInt(customSettingInfo.Row.Name, customSettingInfo.Row.InitialValue);
        }

        Difficulty currentGameDifficulty = GameDifficulty.gameDifficulty.GetCurrentGameDifficulty();

        onGameStart.Invoke(GetDifficultyInfo(currentGameDifficulty));
        DontDestroyOnLoadManager.RemoveObj(GameDifficulty.gameDifficulty.gameObject);
    }
コード例 #3
0
    public void Save()
    {
        DifficultySettingsData difficultySettingsData = new DifficultySettingsData();

        difficultySettingsData.UpdateCustomSettings((int)_columnSlider.value, (int)_rowSlider.value);
    }