@@ -126,10 +126,6 @@ public class PauseManager : MonoBehaviour
126126 /// QualitySettings.vSyncCount = 1;
127127 /// </code>
128128 /// <code>
129- /// //This will set the game to have two VSync per frame
130- /// QualitySettings.vSyncCount = 2;
131- /// </code>
132- /// <code>
133129 /// //This will disable vsync
134130 /// QualitySettings.vSyncCount = 0;
135131 /// </code>
@@ -153,6 +149,18 @@ public class PauseManager : MonoBehaviour
153149 public UnityEngine . UI . Slider audioMasterSlider ;
154150 public UnityEngine . UI . Slider audioMusicSlider ;
155151 public UnityEngine . UI . Slider audioEffectsSlider ;
152+ public UnityEngine . UI . Toggle vSyncToggle ;
153+ public UnityEngine . UI . Toggle aoToggle ;
154+ public UnityEngine . UI . Toggle dofToggle ;
155+ public UnityEngine . UI . Toggle fullscreenToggle ;
156+ /// <summary>
157+ /// The preset text label.
158+ /// </summary>
159+ public Text presetLabel ;
160+ /// <summary>
161+ /// Resolution text label.
162+ /// </summary>
163+ public Text resolutionLabel ;
156164 /// <summary>
157165 /// Lod bias float array. You should manually assign these based on the quality level.
158166 /// </summary>
@@ -174,14 +182,6 @@ public class PauseManager : MonoBehaviour
174182 /// </summary>
175183 public GameObject [ ] otherUIElements ;
176184 /// <summary>
177- /// The preset text label.
178- /// </summary>
179- public Text presetLabel ;
180- /// <summary>
181- /// Resolution text label.
182- /// </summary>
183- public Text resolutionLabel ;
184- /// <summary>
185185 /// Editor boolean for hardcoding certain video settings. It will allow you to use the values defined in LOD Bias and Shadow Distance
186186 /// </summary>
187187 public Boolean hardCodeSomeVideoSettings ;
@@ -209,7 +209,8 @@ public class PauseManager : MonoBehaviour
209209 private Boolean isFullscreen ;
210210 //current resoultion
211211 private Resolution currentRes ;
212-
212+ private Boolean aoBool ;
213+ private Boolean dofBool ;
213214 /*
214215 //Color fade duration value
215216 //public float crossFadeDuration;
@@ -247,8 +248,10 @@ public void Start()
247248 Debug . Log ( "ini res" + currentRes ) ;
248249 resolutionLabel . text = Screen . currentResolution . width . ToString ( ) + " x " + Screen . currentResolution . height . ToString ( ) ;
249250 isFullscreen = Screen . fullScreen ;
250- //get all ini values
251+ //get all specified audio source volumes
251252 _beforeEffectVol = new float [ _audioEffectAmt ] ;
253+ _beforeMaster = AudioListener . volume ;
254+ //get all ini values
252255 aaQualINI = QualitySettings . antiAliasing ;
253256 renderDistINI = mainCam . farClipPlane ;
254257 shadowDistINI = QualitySettings . shadowDistance ;
@@ -431,23 +434,24 @@ public void Audio()
431434 public void audioIn ( )
432435 {
433436 audioPanelAnimator . Play ( "Audio Panel In" ) ;
434- for ( int i = 0 ; i < effects . Length ; i ++ )
435- {
436- audioEffectsSlider . value = effects [ i ] . volume ;
437- }
437+ audioMasterSlider . value = AudioListener . volume ;
438438 for ( int i = 0 ; i < music . Length ; i ++ )
439439 {
440440 audioMusicSlider . value = effects [ i ] . volume ;
441441 }
442- audioMasterSlider . value = AudioListener . volume ;
442+ for ( int i = 0 ; i < effects . Length ; i ++ )
443+ {
444+ audioEffectsSlider . value = effects [ i ] . volume ;
445+ }
446+
443447 }
444448 /// <summary>
445449 /// Audio Option Methods
446450 /// </summary>
447451 /// <param name="f"></param>
448452 public void updateMasterVol ( float f )
449453 {
450- _beforeMaster = AudioListener . volume ;
454+
451455 //Controls volume of all audio listeners
452456 AudioListener . volume = f ;
453457 }
@@ -498,7 +502,7 @@ protected IEnumerator applyAudioMain()
498502 mainPanel . SetActive ( true ) ;
499503 vidPanel . SetActive ( false ) ;
500504 audioPanel . SetActive ( false ) ;
501-
505+ _beforeMaster = AudioListener . volume ;
502506 }
503507 /// <summary>
504508 /// Cancel the audio setting changes
@@ -517,17 +521,16 @@ protected IEnumerator cancelAudioMain()
517521 audioPanelAnimator . Play ( "Audio Panel Out" ) ;
518522 // Debug.Log(audioPanelAnimator.GetCurrentAnimatorClipInfo(0).Length);
519523 yield return StartCoroutine ( CoroutineUtilities . WaitForRealTime ( ( float ) audioPanelAnimator . GetCurrentAnimatorClipInfo ( 0 ) . Length ) ) ;
520- Debug . Log ( "Passed" ) ;
521524 mainPanel . SetActive ( true ) ;
522525 vidPanel . SetActive ( false ) ;
523526 audioPanel . SetActive ( false ) ;
527+ AudioListener . volume = _beforeMaster ;
528+ Debug . Log ( _beforeMaster + AudioListener . volume ) ;
524529 for ( _audioEffectAmt = 0 ; _audioEffectAmt < effects . Length ; _audioEffectAmt ++ )
525530 {
526531 //get the values for all effects before the change
527532 effects [ _audioEffectAmt ] . volume = _beforeEffectVol [ _audioEffectAmt ] ;
528-
529533 }
530- AudioListener . volume = _beforeMaster ;
531534 for ( int _musicAmt = 0 ; _musicAmt < music . Length ; _musicAmt ++ )
532535 {
533536 music [ _musicAmt ] . volume = _beforeMusic ;
@@ -588,6 +591,17 @@ public void videoIn()
588591 modelQualSlider . value = QualitySettings . lodBias ;
589592 renderDistSlider . value = mainCam . farClipPlane ;
590593 shadowDistSlider . value = QualitySettings . shadowDistance ;
594+ fullscreenToggle . isOn = Screen . fullScreen ;
595+ aoToggle . isOn = aoBool ;
596+ dofToggle . isOn = dofBool ;
597+ if ( QualitySettings . vSyncCount == 0 )
598+ {
599+ vSyncToggle . isOn = false ;
600+ }
601+ else
602+ {
603+ vSyncToggle . isOn = true ;
604+ }
591605 try
592606 {
593607 if ( useSimpleTerrain == true )
@@ -638,6 +652,7 @@ protected IEnumerator cancelVideoMain()
638652 mainPanel . SetActive ( true ) ;
639653 vidPanel . SetActive ( false ) ;
640654 audioPanel . SetActive ( false ) ;
655+ Screen . fullScreen = isFullscreen ;
641656 }
642657 catch ( Exception e )
643658 {
@@ -666,7 +681,7 @@ public void apply()
666681
667682 }
668683 /// <summary>
669- /// Use an IEnumerator to first play the animation and then change the video settings
684+ /// Use an IEnumerator to first play the animation and then change the video settings.
670685 /// </summary>
671686 /// <returns></returns>
672687 protected IEnumerator applyVideo ( )
@@ -676,10 +691,10 @@ protected IEnumerator applyVideo()
676691 mainPanel . SetActive ( true ) ;
677692 vidPanel . SetActive ( false ) ;
678693 audioPanel . SetActive ( false ) ;
679-
680694 renderDistINI = mainCam . farClipPlane ;
681695 shadowDistINI = QualitySettings . shadowDistance ;
682696 fovINI = mainCam . fieldOfView ;
697+ isFullscreen = Screen . fullScreen ;
683698 try {
684699 if ( useSimpleTerrain == true )
685700 {
@@ -691,11 +706,6 @@ protected IEnumerator applyVideo()
691706 }
692707 }
693708 catch ( Exception e ) { Debug . Log ( e ) ; }
694-
695-
696-
697-
698-
699709 }
700710 /// <summary>
701711 /// Video Options
@@ -825,8 +835,6 @@ public void updateTerrainLod(float qual)
825835 public void updateFOV ( float fov )
826836 {
827837 mainCam . fieldOfView = fov ;
828-
829-
830838 }
831839 /// <summary>
832840 /// Toggle on or off Depth of Field. This is meant to be used with a checkbox.
@@ -838,10 +846,12 @@ public void toggleDOF(Boolean b)
838846 if ( b == true )
839847 {
840848 tempScript . enabled = true ;
849+ dofBool = true ;
841850 }
842851 else
843852 {
844853 tempScript . enabled = false ;
854+ dofBool = false ;
845855 }
846856
847857 }
@@ -855,10 +865,12 @@ public void toggleAO(Boolean b)
855865 if ( b == true )
856866 {
857867 tempScript . enabled = true ;
868+ aoBool = true ;
858869 }
859870 else
860871 {
861872 tempScript . enabled = false ;
873+ aoBool = false ;
862874 }
863875
864876 }
0 commit comments