// Load from PlayerPrefs public void Load() { int PlayerPrefsIsAlreadyUsed = PlayerPrefs.GetInt("PlayerPrefsIsAlreadyUsed"); if (PlayerPrefsIsAlreadyUsed == 1) { m_Music = PlayerPrefs.GetFloat("Music"); m_Sound = PlayerPrefs.GetFloat("Sound"); int Vibration = PlayerPrefs.GetInt("Vibration"); if (Vibration == 1) { m_Vibration = true; } else { m_Vibration = false; } int AutoUpdate = PlayerPrefs.GetInt("AutoUpdate"); if (AutoUpdate == 1) { m_AutoUpdate = true; } else { m_AutoUpdate = false; } int Notifications = PlayerPrefs.GetInt("Notifications"); if (Notifications == 1) { m_Notifications = true; } else { m_Notifications = false; } int GraphicQuality = PlayerPrefs.GetInt("GraphicQuality"); switch (GraphicQuality) { case 0: m_Quality = UIPT_PRO_Demo_Config.eGraphicQuality.Low; break; case 1: m_Quality = UIPT_PRO_Demo_Config.eGraphicQuality.Medium; break; case 2: m_Quality = UIPT_PRO_Demo_Config.eGraphicQuality.High; break; } } else { LoadDefault(); } }
// ######################################## // Utilitie functions // ######################################## #region Utilitie functions // Set current configs to default public void LoadDefault() { m_Music = m_Music_Default; m_Sound = m_Sound_Default; m_Vibration = m_Vibration_Default; m_AutoUpdate = m_AutoUpdate_Default; m_Notifications = m_Notifications_Default; m_Quality = m_Quality_Default; }