Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Save slider value at runtime, and reload latest value on launch

Discussion in 'Editor & General Support' started by eco_bach, Nov 4, 2015.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    I have an application which has a 'volume trigger' whose sensitivity can be controlled via a slider.

    I would like to configure it so that if a user changes the sensitivity and quits the application, the latest value is loaded in the application on launch.

    So there are 2 steps,
    1 - serializing and saving the slider value, overwriting any previous value

    2 -loading this value when the application launches

    Can any C# gurus help with some scripting pointers, tips suggestions?
     
  2. Thelord

    Thelord

    Joined:
    Dec 27, 2013
    Posts:
    3
    you may try "PlayerPrefs", it's a built-in class in unity engine, pretty handy to use.