Skip to content

Commit

Permalink
Audio panel updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatArcStudios committed Feb 17, 2016
1 parent 79bfa8d commit 415c539
Show file tree
Hide file tree
Showing 30 changed files with 47 additions and 15,049 deletions.
Binary file modified Pause Menu Assetstore/.vs/Pause Menu Assetstore/v14/.suo
Binary file not shown.
Binary file modified Pause Menu Assetstore/Assets/Pause Menu Assets/Pausemenu.unity
Binary file not shown.
Expand Up @@ -126,10 +126,6 @@ public class PauseManager : MonoBehaviour
/// QualitySettings.vSyncCount = 1;
/// </code>
/// <code>
/// //This will set the game to have two VSync per frame
/// QualitySettings.vSyncCount = 2;
/// </code>
/// <code>
/// //This will disable vsync
/// QualitySettings.vSyncCount = 0;
/// </code>
Expand All @@ -153,6 +149,18 @@ public class PauseManager : MonoBehaviour
public UnityEngine.UI.Slider audioMasterSlider;
public UnityEngine.UI.Slider audioMusicSlider;
public UnityEngine.UI.Slider audioEffectsSlider;
public UnityEngine.UI.Toggle vSyncToggle;
public UnityEngine.UI.Toggle aoToggle;
public UnityEngine.UI.Toggle dofToggle;
public UnityEngine.UI.Toggle fullscreenToggle;
/// <summary>
/// The preset text label.
/// </summary>
public Text presetLabel;
/// <summary>
/// Resolution text label.
/// </summary>
public Text resolutionLabel;
/// <summary>
/// Lod bias float array. You should manually assign these based on the quality level.
/// </summary>
Expand All @@ -174,14 +182,6 @@ public class PauseManager : MonoBehaviour
/// </summary>
public GameObject[] otherUIElements;
/// <summary>
/// The preset text label.
/// </summary>
public Text presetLabel;
/// <summary>
/// Resolution text label.
/// </summary>
public Text resolutionLabel;
/// <summary>
/// Editor boolean for hardcoding certain video settings. It will allow you to use the values defined in LOD Bias and Shadow Distance
/// </summary>
public Boolean hardCodeSomeVideoSettings;
Expand Down Expand Up @@ -209,7 +209,8 @@ public class PauseManager : MonoBehaviour
private Boolean isFullscreen;
//current resoultion
private Resolution currentRes;

private Boolean aoBool;
private Boolean dofBool;
/*
//Color fade duration value
//public float crossFadeDuration;
Expand Down Expand Up @@ -247,8 +248,10 @@ public void Start()
Debug.Log("ini res" + currentRes);
resolutionLabel.text = Screen.currentResolution.width.ToString() + " x " + Screen.currentResolution.height.ToString();
isFullscreen = Screen.fullScreen;
//get all ini values
//get all specified audio source volumes
_beforeEffectVol = new float[_audioEffectAmt];
_beforeMaster = AudioListener.volume;
//get all ini values
aaQualINI = QualitySettings.antiAliasing;
renderDistINI = mainCam.farClipPlane;
shadowDistINI = QualitySettings.shadowDistance;
Expand Down Expand Up @@ -431,23 +434,24 @@ public void Audio()
public void audioIn()
{
audioPanelAnimator.Play("Audio Panel In");
for (int i = 0; i < effects.Length; i++)
{
audioEffectsSlider.value = effects[i].volume;
}
audioMasterSlider.value = AudioListener.volume;
for (int i = 0; i < music.Length; i++)
{
audioMusicSlider.value = effects[i].volume;
}
audioMasterSlider.value = AudioListener.volume;
for (int i = 0; i < effects.Length; i++)
{
audioEffectsSlider.value = effects[i].volume;
}

}
/// <summary>
/// Audio Option Methods
/// </summary>
/// <param name="f"></param>
public void updateMasterVol(float f)
{
_beforeMaster = AudioListener.volume;

//Controls volume of all audio listeners
AudioListener.volume = f;
}
Expand Down Expand Up @@ -498,7 +502,7 @@ protected IEnumerator applyAudioMain()
mainPanel.SetActive(true);
vidPanel.SetActive(false);
audioPanel.SetActive(false);

_beforeMaster = AudioListener.volume;
}
/// <summary>
/// Cancel the audio setting changes
Expand All @@ -517,17 +521,16 @@ protected IEnumerator cancelAudioMain()
audioPanelAnimator.Play("Audio Panel Out");
// Debug.Log(audioPanelAnimator.GetCurrentAnimatorClipInfo(0).Length);
yield return StartCoroutine(CoroutineUtilities.WaitForRealTime((float)audioPanelAnimator.GetCurrentAnimatorClipInfo(0).Length));
Debug.Log("Passed");
mainPanel.SetActive(true);
vidPanel.SetActive(false);
audioPanel.SetActive(false);
AudioListener.volume = _beforeMaster;
Debug.Log(_beforeMaster +AudioListener.volume);
for (_audioEffectAmt = 0; _audioEffectAmt < effects.Length; _audioEffectAmt++)
{
//get the values for all effects before the change
effects[_audioEffectAmt].volume = _beforeEffectVol[_audioEffectAmt];

}
AudioListener.volume = _beforeMaster;
for (int _musicAmt = 0; _musicAmt < music.Length; _musicAmt++)
{
music[_musicAmt].volume = _beforeMusic;
Expand Down Expand Up @@ -588,6 +591,17 @@ public void videoIn()
modelQualSlider.value = QualitySettings.lodBias;
renderDistSlider.value = mainCam.farClipPlane;
shadowDistSlider.value = QualitySettings.shadowDistance;
fullscreenToggle.isOn = Screen.fullScreen;
aoToggle.isOn = aoBool;
dofToggle.isOn = dofBool;
if(QualitySettings.vSyncCount == 0)
{
vSyncToggle.isOn = false;
}
else
{
vSyncToggle.isOn = true;
}
try
{
if (useSimpleTerrain == true)
Expand Down Expand Up @@ -638,6 +652,7 @@ protected IEnumerator cancelVideoMain()
mainPanel.SetActive(true);
vidPanel.SetActive(false);
audioPanel.SetActive(false);
Screen.fullScreen = isFullscreen;
}
catch (Exception e)
{
Expand Down Expand Up @@ -666,7 +681,7 @@ public void apply()

}
/// <summary>
/// Use an IEnumerator to first play the animation and then change the video settings
/// Use an IEnumerator to first play the animation and then change the video settings.
/// </summary>
/// <returns></returns>
protected IEnumerator applyVideo()
Expand All @@ -676,10 +691,10 @@ protected IEnumerator applyVideo()
mainPanel.SetActive(true);
vidPanel.SetActive(false);
audioPanel.SetActive(false);

renderDistINI = mainCam.farClipPlane;
shadowDistINI = QualitySettings.shadowDistance;
fovINI = mainCam.fieldOfView;
isFullscreen = Screen.fullScreen;
try {
if (useSimpleTerrain == true)
{
Expand All @@ -691,11 +706,6 @@ protected IEnumerator applyVideo()
}
}
catch(Exception e) { Debug.Log(e); }





}
/// <summary>
/// Video Options
Expand Down Expand Up @@ -825,8 +835,6 @@ public void updateTerrainLod(float qual)
public void updateFOV(float fov)
{
mainCam.fieldOfView = fov;


}
/// <summary>
/// Toggle on or off Depth of Field. This is meant to be used with a checkbox.
Expand All @@ -838,10 +846,12 @@ public void toggleDOF(Boolean b)
if (b == true)
{
tempScript.enabled = true;
dofBool = true;
}
else
{
tempScript.enabled = false;
dofBool = false;
}

}
Expand All @@ -855,10 +865,12 @@ public void toggleAO(Boolean b)
if (b == true)
{
tempScript.enabled = true;
aoBool = true;
}
else
{
tempScript.enabled = false;
aoBool = false;
}

}
Expand Down
4 changes: 2 additions & 2 deletions Pause Menu Assetstore/Docs/Doxyfile
Expand Up @@ -868,7 +868,7 @@ IGNORE_PREFIX =
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.

GENERATE_HTML = YES
GENERATE_HTML = NO

# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
Expand Down Expand Up @@ -1222,7 +1222,7 @@ SERVER_BASED_SEARCH = NO
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.

GENERATE_LATEX = NO
GENERATE_LATEX = YES

# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
Expand Down
Binary file modified Pause Menu Assetstore/Library/CurrentLayout.dwlt
Binary file not shown.
Binary file modified Pause Menu Assetstore/Library/InspectorExpandedItems.asset
Binary file not shown.
Binary file modified Pause Menu Assetstore/Library/ScriptAssemblies/Assembly-CSharp.dll
Binary file not shown.
Binary file not shown.

0 comments on commit 415c539

Please sign in to comment.