@@ -79,7 +79,7 @@ public class PauseManager : MonoBehaviour
7979 /// <summary>
8080 /// The terrain detail density float. It's only public because you may want to adjust it in editor
8181 /// </summary>
82- public float detailDensity ;
82+ public float detailDensity ;
8383
8484 /// <summary>
8585 /// Timescale value. The defualt is 1 for most games. You may want to change it if you are pausing the game in a slow motion situation
@@ -88,11 +88,11 @@ public class PauseManager : MonoBehaviour
8888 /// <summary>
8989 /// One terrain variable used if you have a terrain plugin like rtp.
9090 /// </summary>
91- public Terrain terrain ;
91+ public Terrain terrain ;
9292 /// <summary>
9393 /// Other terrain variable used if you want to have an option to target low end harware.
9494 /// </summary>
95- public Terrain simpleTerrain ;
95+ public Terrain simpleTerrain ;
9696 /// <summary>
9797 /// Inital shadow distance
9898 /// </summary>
@@ -169,19 +169,19 @@ public class PauseManager : MonoBehaviour
169169 /// <summary>
170170 /// Lod bias float array. You should manually assign these based on the quality level.
171171 /// </summary>
172- public float [ ] LODBias ;
172+ public float [ ] LODBias ;
173173 /// <summary>
174174 /// Shadow distance array. You should manually assign these based on the quality level.
175175 /// </summary>
176- public float [ ] shadowDist ;
176+ public float [ ] shadowDist ;
177177 /// <summary>
178178 /// An array of music audio sources
179179 /// </summary>
180- public AudioSource [ ] music ;
180+ public AudioSource [ ] music ;
181181 /// <summary>
182182 /// An array of sound effect audio sources
183183 /// </summary>
184- public AudioSource [ ] effects ;
184+ public AudioSource [ ] effects ;
185185 /// <summary>
186186 /// An array of the other UI elements, which is used for disabling the other elements when the game is paused.
187187 /// </summary>
@@ -193,7 +193,7 @@ public class PauseManager : MonoBehaviour
193193 /// <summary>
194194 /// Boolean for turning on simple terrain
195195 /// </summary>
196- public Boolean useSimpleTerrain ;
196+ public Boolean useSimpleTerrain ;
197197 public static Boolean readUseSimpleTerrain ;
198198 /// <summary>
199199 /// Event system
@@ -243,7 +243,7 @@ public class PauseManager : MonoBehaviour
243243
244244 //last shadow cascade value
245245 internal static int lastShadowCascade ;
246-
246+
247247 public static Boolean aoBool ;
248248 public static Boolean dofBool ;
249249 private Boolean lastAOBool ;
@@ -279,7 +279,7 @@ public class PauseManager : MonoBehaviour
279279 /// </summary>
280280 public void Start ( )
281281 {
282-
282+
283283 readUseSimpleTerrain = useSimpleTerrain ;
284284 if ( useSimpleTerrain )
285285 {
@@ -289,7 +289,7 @@ public void Start()
289289 {
290290 readTerrain = terrain ;
291291 }
292-
292+
293293 mainCamShared = mainCam ;
294294 //Set the lastmusicmult and last audiomult
295295 lastMusicMult = audioMusicSlider . value ;
@@ -333,7 +333,16 @@ public void Start()
333333 lastTexLimit = QualitySettings . masterTextureLimit ;
334334 //set last shadow cascade
335335 lastShadowCascade = QualitySettings . shadowCascades ;
336- saveSettings . LoadGameSettings ( File . ReadAllText ( Application . persistentDataPath + "/" + saveSettings . fileName ) ) ;
336+ try
337+ {
338+ saveSettings . LoadGameSettings ( File . ReadAllText ( Application . persistentDataPath + "/" + saveSettings . fileName ) ) ;
339+ }
340+ catch
341+ {
342+ Debug . Log ( "Game settings not found in: " + Application . persistentDataPath + "/" + saveSettings . fileName ) ;
343+ saveSettings . SaveGameSettings ( ) ;
344+ }
345+
337346 try
338347 {
339348 densityINI = Terrain . activeTerrain . detailObjectDensity ;
@@ -362,6 +371,7 @@ public void Restart()
362371 {
363372 Application . LoadLevel ( Application . loadedLevel ) ;
364373 uiEventSystem . firstSelectedGameObject = defualtSelectedMain ;
374+
365375 }
366376 /// <summary>
367377 /// Method to resume the game, so disable the pause menu and re-enable all other ui elements
@@ -467,7 +477,9 @@ public void Update()
467477 blurEffect.enabled = true;
468478 } */
469479 }
470- else if ( Input . GetKeyDown ( KeyCode . Escape ) && mainPanel . active == true ) {
480+ else if ( Input . GetKeyDown ( KeyCode . Escape ) && mainPanel . active == true )
481+ {
482+
471483 Time . timeScale = timeScale ;
472484 mainPanel . SetActive ( false ) ;
473485 vidPanel . SetActive ( false ) ;
@@ -606,7 +618,7 @@ public void applyAudio()
606618 {
607619 StartCoroutine ( applyAudioMain ( ) ) ;
608620 uiEventSystem . SetSelectedGameObject ( defualtSelectedMain ) ;
609-
621+
610622 }
611623 /// <summary>
612624 /// Use an IEnumerator to first play the animation and then change the audio settings
@@ -823,7 +835,7 @@ public void apply()
823835 {
824836 StartCoroutine ( applyVideo ( ) ) ;
825837 uiEventSystem . SetSelectedGameObject ( defualtSelectedMain ) ;
826-
838+
827839 }
828840 /// <summary>
829841 /// Use an IEnumerator to first play the animation and then change the video settings.
@@ -1062,7 +1074,7 @@ public void toggleAO(Boolean b)
10621074 /// <param name="b"></param>
10631075 public void setFullScreen ( Boolean b )
10641076 {
1065-
1077+
10661078
10671079 if ( b == true )
10681080 {
0 commit comments