Exemplo n.º 1
0
    private void LoadLocalConfig()
    {
        string configToLoadVersion = PlayerPrefs.GetString(configVersionKey);

        currentConfig.deviceType = (DeviceType)PlayerPrefs.GetInt(deviceTypeKey);

        if (!VersionUtils.AreVersionsCompatible(currentConfig.version, configToLoadVersion))
        {
            Debug.LogWarning("Config found incompatible with current version");
            LaunchConfigSetup();
        }
        else
        {
            if (!VersionUtils.Equals(currentConfig.version, configToLoadVersion))
            {
                // Save config with new version, some fields may be saved with default values
                SaveConfig();
                Debug.LogWarning("Resaving config with latest version, check that everything is OK");
                isConfLoaded = true;
            }
        }
    }