public void SaveSensitivySetting(SensitivtySetting sensitivtySetting, int newSetting) { if (sensitivtySetting == SensitivtySetting.CameraSensitivityX) { PlayerPrefs.SetInt("CameraSensitivityX", newSetting); CameraSensitivityX = newSetting; } else if (sensitivtySetting == SensitivtySetting.CameraSensitivityY) { CameraSensitivityY = newSetting; PlayerPrefs.SetInt("CameraSensitivityY", newSetting); } }
public int GetSensitivySetting(SensitivtySetting sensitivtySetting) { int newValue = 50; if (sensitivtySetting == SensitivtySetting.CameraSensitivityX) { newValue = PlayerPrefs.GetInt("CameraSensitivityX") != 0 ? PlayerPrefs.GetInt("CameraSensitivityX") : 50; CameraSensitivityX = newValue; } else if (sensitivtySetting == SensitivtySetting.CameraSensitivityY) { newValue = PlayerPrefs.GetInt("CameraSensitivityY") != 0 ? PlayerPrefs.GetInt("CameraSensitivityY") : 50; CameraSensitivityY = newValue; } return(newValue); }