// 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); } }
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); }
public void Save() { DifficultySettingsData difficultySettingsData = new DifficultySettingsData(); difficultySettingsData.UpdateCustomSettings((int)_columnSlider.value, (int)_rowSlider.value); }