// 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 (!PlayerPrefs.HasKey("togglehold_carry"))
        {
            DeveloperPreferences.Gameplay();
        }

        squat_text.text = PlayerPrefs.GetString("togglehold_squat");
        carry_text.text = PlayerPrefs.GetString("togglehold_carry");

        enemy_health.value = PlayerPrefs.GetInt("enemy_health_percentage") + 0.01f;
        enemy_damage.value = PlayerPrefs.GetInt("enemy_damage_percentage") + 0.01f;
    }
    // Start is called before the first frame update
    void Start()
    {
        if (!PlayerPrefs.HasKey("sound_universal"))
        {
            DeveloperPreferences.Sound();
        }

        universal_slider.value   = PlayerPrefs.GetInt("sound_universal") + 0.01f;
        music_slider.value       = PlayerPrefs.GetInt("sound_music") + 0.01f;
        dialogue_slider.value    = PlayerPrefs.GetInt("sound_dialogue") + 0.01f;
        environment_slider.value = PlayerPrefs.GetInt("sound_environment") + 0.01f;

        universal_text.text   = PlayerPrefs.GetInt("sound_universal") + "";
        music_text.text       = PlayerPrefs.GetInt("sound_music") + "";
        dialogue_text.text    = PlayerPrefs.GetInt("sound_dialogue") + "";
        environment_text.text = PlayerPrefs.GetInt("sound_environment") + "";
    }
    // 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 #5
0
    // Start is called before the first frame update
    void Start()
    {
        if (!PlayerPrefs.HasKey("General Action"))
        {
            DeveloperPreferences.Keybinds();
        }

        //action_general.text = PlayerPrefs.GetString("General Action");
        //toolbelt_one.text = PlayerPrefs.GetString("Toolbelt One");
        //toolbelt_two.text = PlayerPrefs.GetString("Toolbelt Two");
        //toolbelt_three.text = PlayerPrefs.GetString("Toolbelt Three");
        //toolbelt_four.text = PlayerPrefs.GetString("Toolbelt Four");
        //toolbelt_five.text = PlayerPrefs.GetString("Toolbelt Five");
        //toolbelt_six.text = PlayerPrefs.GetString("Toolbelt Six");
        //toolbelt_seven.text = PlayerPrefs.GetString("Toolbelt Seven");
        //toolbelt_eight.text = PlayerPrefs.GetString("Toolbelt Eight");
        //toolbelt_nine.text = PlayerPrefs.GetString("Toolbelt Nine");
        //toolbelt_ten.text = PlayerPrefs.GetString("Toolbelt Ten");
        //attack_primary.text = PlayerPrefs.GetString("Primary Attack");
        //attack_secondary.text = PlayerPrefs.GetString("Secondary Attack");
        //attack_tertiary.text = PlayerPrefs.GetString("Tertiary Attack");
        //kick.text = PlayerPrefs.GetString("Kick");
        //block.text = PlayerPrefs.GetString("Block");
        //move_forward.text = PlayerPrefs.GetString("Move Forward");
        //move_backward.text = PlayerPrefs.GetString("Move Backward");
        //move_left.text = PlayerPrefs.GetString("Move Left");
        //move_right.text = PlayerPrefs.GetString("Move Right");
        //jump.text = PlayerPrefs.GetString("Jump");
        //squat.text = PlayerPrefs.GetString("Squat");
        //speed_toggle.text = PlayerPrefs.GetString("Speed Toggle");
        //toolbelt_scroll_up.text = PlayerPrefs.GetString("Toolbelt Scroll Up");
        //toolbelt_scroll_down.text = PlayerPrefs.GetString("Toolbelt Scroll Down");
        //drop.text = PlayerPrefs.GetString("Drop");
        //quicksave.text = PlayerPrefs.GetString("Quicksave");
        //quickload.text = PlayerPrefs.GetString("Quickload");
        //pause.text = PlayerPrefs.GetString("Pause");
        //log.text = PlayerPrefs.GetString("Log");
        //objectives.text = PlayerPrefs.GetString("Objectives");
        //stats.text = PlayerPrefs.GetString("Stats");
        //gamma_up.text = PlayerPrefs.GetString("Gamma Up");
        //gamma_down.text = PlayerPrefs.GetString("Gamma Down");
        //item_rotate.text = PlayerPrefs.GetString("Item Rotate");
        //lean_left.text = PlayerPrefs.GetString("Lean Left");
        //lean_right.text = PlayerPrefs.GetString("Lean Right");



        action_array = new string[] { "General Action", "Toolbelt One", "Toolbelt Two", "Toolbelt Three", "Toolbelt Four", "Toolbelt Five", "Toolbelt Six", "Toolbelt Seven",
                                      "Toolbelt Eight", "Toolbelt Nine", "Toolbelt Ten", "Primary Attack", "Secondary Attack", "Tertiary Attack", "Kick", "Block", "Move Forward", "Move Backward", "Move Left", "Move Right",
                                      "Jump", "Squat", "Speed Toggle", "Toolbelt Scroll Up", "Toolbelt Scroll Down", "Drop", "Quicksave", "Quickload", "Pause", "Log", "Objectives", "Stats", "Gamma Up", "Gamma Down",
                                      "Item Rotate", "Lean Left", "Lean Right" };

        float y_position = 0;

        foreach (string action in action_array)
        {
            GameObject keybinder = Instantiate(Resources.Load <GameObject>("Keybind Template"), content.GetComponent <RectTransform>().position, new Quaternion(0, 0, 0, 0));

            keybinder.transform.parent = content.transform;

            keybinder.GetComponent <RectTransform>().position += new Vector3(241.5f, -21.65f - y_position, 0);

            y_position += 50.0f;

            keybinder.transform.GetChild(0).GetComponent <TMPro.TextMeshProUGUI>().text = action;

            keybinder.transform.GetChild(1).GetChild(0).GetComponent <Text>().text = PlayerPrefs.GetString(action);

            keybinder.transform.GetChild(1).GetComponent <Button>().onClick.AddListener(delegate() { DoBoth(action, keybinder.transform.GetChild(1).gameObject); });
        }
    }
Exemple #6
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");
    }