Пример #1
0
    public SettingsData(SettingsUiHelper settings)
    {
        this.resolutionHeight = Screen.currentResolution.height;
        this.resolutionWidth  = Screen.currentResolution.width;
        this.fullScreen       = Screen.fullScreen;
        this.graphicsQuality  = QualitySettings.GetQualityLevel();
        settings.musicAudio.GetFloat("volume", out this.musicVolume);
        settings.fxaudio.GetFloat("volume", out this.sfxVolume);
        this.showTips = SettingsUiHelper.showTips;

        Debug.Log(resolutionWidth + " x " + resolutionHeight + " " + fullScreen);
    }
Пример #2
0
    public static void SaveSettings(SettingsUiHelper settings)
    {
        Debug.Log(settingsPath);

        BinaryFormatter formatter = new BinaryFormatter();
        FileStream      stream    = new FileStream(settingsPath, FileMode.Create);

        SettingsData data = new SettingsData(settings);

        formatter.Serialize(stream, data);
        stream.Close();

        Debug.Log("Settings file saved at: " + mapPath);
    }