// Start is called before the first frame update
    void Start()
    {
        if (!PlayerPrefs.HasKey("General Action"))
        {
            DeveloperPreferences.Keybinds();
        }

        if (!PlayerPrefs.HasKey("fullscreen"))
        {
            DeveloperPreferences.Graphics();
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        if (SceneManager.GetActiveScene().name == "MainMenu")
        {
            // In the case that the game was terminated unexpectedly,
            // the auxiliary save file may still be there. (it should be deleted on game exit)
            // This is a precautionary measure.
            Serialization.DeleteDirectory(Application.persistentDataPath + "/saves/savedgames/auxiliary");
        }

        if (!PlayerPrefs.HasKey("General Action"))
        {
            DeveloperPreferences.Keybinds();
        }

        if (!PlayerPrefs.HasKey("fullscreen"))
        {
            DeveloperPreferences.Graphics();
        }
    }
Exemple #3
0
    // Start is called before the first frame update
    void Start()
    {
        if (!PlayerPrefs.HasKey("fullscreen"))
        {
            DeveloperPreferences.Graphics();
        }

        res_array = new Resolution[]
        {
            new Resolution(320, 200),
            new Resolution(400, 300),
            new Resolution(512, 384),
            new Resolution(640, 400),
            new Resolution(800, 600),
            new Resolution(1024, 768),
            new Resolution(1152, 864),
            new Resolution(1280, 600),
            new Resolution(1360, 768),
            new Resolution(1400, 1050),
            new Resolution(1440, 900),
            new Resolution(1680, 1050),
            new Resolution(1920, 1080)
        };

        if (!PlayerPrefs.HasKey("width") ||
            PlayerPrefs.GetInt("width") == 1920)
        {
            res_array_pointer = res_array.Length - 1;
        }
        else if (PlayerPrefs.GetInt("width") == 320)
        {
            res_array_pointer = 0;
        }
        else if (PlayerPrefs.GetInt("width") == 400)
        {
            res_array_pointer = 1;
        }
        else if (PlayerPrefs.GetInt("width") == 512)
        {
            res_array_pointer = 2;
        }
        else if (PlayerPrefs.GetInt("width") == 640)
        {
            res_array_pointer = 3;
        }
        else if (PlayerPrefs.GetInt("width") == 800)
        {
            res_array_pointer = 4;
        }
        else if (PlayerPrefs.GetInt("width") == 1024)
        {
            res_array_pointer = 5;
        }
        else if (PlayerPrefs.GetInt("width") == 1152)
        {
            res_array_pointer = 6;
        }
        else if (PlayerPrefs.GetInt("width") == 1280)
        {
            res_array_pointer = 7;
        }
        else if (PlayerPrefs.GetInt("width") == 1360)
        {
            res_array_pointer = 8;
        }
        else if (PlayerPrefs.GetInt("width") == 1400)
        {
            res_array_pointer = 9;
        }
        else if (PlayerPrefs.GetInt("width") == 1440)
        {
            res_array_pointer = 10;
        }
        else if (PlayerPrefs.GetInt("width") == 1680)
        {
            res_array_pointer = 11;
        }
        else
        {
            res_array_pointer = res_array.Length - 1;
        }

        fullscreen_button.isOn         = (PlayerPrefs.GetInt("fullscreen") == 1);
        vsync_button.isOn              = (PlayerPrefs.GetInt("vsync") == 1);
        bilinear_filtering_button.isOn = (PlayerPrefs.GetInt("bilinear_filtering") == 1);
        bloom_button.isOn              = (PlayerPrefs.GetInt("bloom") == 1);
        flares_button.isOn             = (PlayerPrefs.GetInt("flares") == 1);

        fov_slider.value          = PlayerPrefs.GetInt("fov");
        frame_cap_slider.value    = PlayerPrefs.GetInt("frame_cap");
        pixelization_slider.value = PlayerPrefs.GetInt("pixelization");
        gamma_slider.value        = PlayerPrefs.GetInt("gamma");
    }