internal void Load() { switch (uiType) { case UI.InputField: //InputField switch (infData) { case InputFieldData.Int: //InputField Int iValue = PlayerPrefs.GetInt(name, iValue); break; case InputFieldData.Float: //InputField Float fValue = PlayerPrefs.GetFloat(name, fValue); break; case InputFieldData.String: //InputField String sValue = PlayerPrefs.GetString(name, sValue); break; } break; case UI.Slider: //Slider switch (slData) { case SliderData.Int: //Slider Int iValue = PlayerPrefs.GetInt(name, iValue); break; case SliderData.Float: //Slider Float fValue = PlayerPrefs.GetFloat(name, fValue); break; } break; case UI.Toggle: //Toggle bValue = MenuTools.intToBool(PlayerPrefs.GetInt(name, MenuTools.boolToInt(bValue))); break; case UI.DropDown: //DropDown iValue = PlayerPrefs.GetInt(name, iValue); break; } UpdateUI(); }
internal void Save() { switch (uiType) { case UI.InputField: //InputField switch (infData) { case InputFieldData.Int: //InputField Int PlayerPrefs.SetInt(name, iValue); break; case InputFieldData.Float: //InputField Float PlayerPrefs.SetFloat(name, fValue); break; case InputFieldData.String: //InputField String PlayerPrefs.SetString(name, sValue); break; } break; case UI.Slider: //Slider switch (slData) { case SliderData.Int: //Slider Int PlayerPrefs.SetInt(name, iValue); break; case SliderData.Float: //Slider Float PlayerPrefs.SetFloat(name, fValue); break; } break; case UI.Toggle: //Toggle PlayerPrefs.SetInt(name, MenuTools.boolToInt(bValue)); break; case UI.DropDown: //DropDown PlayerPrefs.SetInt(name, iValue); break; } }