Example #1
0
 void Start()
 {
     sw = new SettingsWriter();
     Debug.LogError(File.Exists(Application.persistentDataPath + "/settings.dat") + " " + Application.persistentDataPath + "/settings.dat");
     if (File.Exists(Application.persistentDataPath + "/settings.dat") == true)
     {
         sw.loadSettings();
         //will need to delete the settings.dat file if I add any more info to the settings class
     }
     else
     {
         sw.saveSettings();
     }
     setVolumes();
     // ls = GameObject.FindGameObjectWithTag("LoadScreen").GetComponent<LoadScreen>();
 }
Example #2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         if (paused == false)
         {
             paused         = true;
             Time.timeScale = 0;
         }
         else if (paused == true)
         {
             Time.timeScale = 1;
             paused         = false;
             setVolumes();
             sw.saveSettings();
         }
     }
 }