Exemplo n.º 1
0
 // Token: 0x0600003D RID: 61 RVA: 0x00006668 File Offset: 0x00004868
 private void OnGUI()
 {
     if (!this.options)
     {
         if (this.alphaFadeValue > 0f)
         {
             this.alphaFadeValue -= Mathf.Clamp01(Time.deltaTime / 2f);
         }
         GUI.skin.button.wordWrap = true;
         GUI.depth = 2;
         GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 1f);
         if (this.fadeOut)
         {
             GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 1f - this.alphaFadeValue);
             GUI.depth = 0;
             GUI.BeginGroup(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height));
             GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), this.loadTexture);
             GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, this.alphaFadeValue);
             GUI.EndGroup();
         }
         GUI.BeginGroup(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height));
         GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), this.blackTexture);
         if (this.fadeIn)
         {
             GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, this.startFadeValue);
         }
         GUI.DrawTexture(new Rect(this.difference.x, this.difference.y, this.size.x, this.size.y), this.menuTexture);
         GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 1f);
         GUIHelpers.DrawSpeedyTex(new Rect(100f * scale.x, Screen.height - (400f + 100f) * scale.y, 800 * scale.x, 400 * scale.y), GUIHelpers.EaseInOutBounce, easeScaleCloserTo1: 0.6f);
         GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, this.startFadeValue);
         GUI.EndGroup();
         GUI.depth = 1;
         GUI.BeginGroup(new Rect(this.difference.x, this.difference.y, this.size.x, this.size.y));
         GUI.skin.button.normal.background = this.playTextures[0];
         GUI.skin.button.hover.background  = this.playTextures[1];
         GUI.skin.button.active.background = this.playTextures[0];
         if (GUI.Button(new Rect(this.playTexturePos.x, this.playTexturePos.y, this.playTextureSize.x, this.playTextureSize.y), string.Empty) && !this.credits && this.alphaFadeValue <= 0f && this.mouseDown)
         {
             this.alphaFadeValue = 1f;
             this.mouseDown      = false;
             this.fadeOut        = true;
         }
         GUI.skin.button.normal.background = this.quitTextures[0];
         GUI.skin.button.hover.background  = this.quitTextures[1];
         GUI.skin.button.active.background = this.quitTextures[0];
         if (GUI.Button(new Rect(this.quitTexturePos.x, this.quitTexturePos.y, this.quitTextureSize.x, this.quitTextureSize.y), string.Empty) && !this.credits && this.alphaFadeValue <= 0f && this.mouseDown)
         {
             Application.Quit();
             this.mouseDown = false;
         }
         GUI.skin.button.normal.background = this.creditTextures[0];
         GUI.skin.button.hover.background  = this.creditTextures[1];
         GUI.skin.button.active.background = this.creditTextures[0];
         if (GUI.Button(new Rect(this.creditTexturePos.x, this.creditTexturePos.y, this.creditTextureSize.x, this.creditTextureSize.y), string.Empty) && !this.credits && this.alphaFadeValue <= 0f && this.mouseDown)
         {
             this.credits   = true;
             this.mouseDown = false;
         }
         GUI.skin.button.normal.background = this.optionTextures[0];
         GUI.skin.button.hover.background  = this.optionTextures[1];
         GUI.skin.button.active.background = this.optionTextures[0];
         if (GUI.Button(new Rect(this.optionTexturePos.x, this.optionTexturePos.y, this.optionTextureSize.x, this.optionTextureSize.y), string.Empty) && !this.credits && this.alphaFadeValue <= 0f && this.mouseDown)
         {
             this.options   = true;
             this.mouseDown = false;
         }
         GUI.EndGroup();
         if (this.credits)
         {
             GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 1f - this.alphaFadeValue);
             GUI.BeginGroup(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height));
             GUI.DrawTexture(new Rect(this.difference.x, this.difference.y, this.size.x, this.size.y), this.creditTexture);
             GUI.EndGroup();
         }
         else if (this.fadeOut)
         {
             GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, this.alphaFadeValue);
         }
         GUI.BeginGroup(new Rect(50f * scale.x, 50 * scale.y, 800f * scale.x, Screen.height));
         GUI.skin.label.fontSize = (int)(30 * scale.y);
         GUIHelpers.DrawControlsInfo(800f * scale.x);
         GUI.EndGroup();
         GUI.skin.label.fontSize = 50;
         //GUI.Label(new Rect(50, 50, Screen.width, Screen.height), new GUIContent("TEST LABEL -- this.options == false"));
     }
     else
     {
         GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), this.blackTexture);
         GUI.depth = 2;
         GUI.BeginGroup(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height));
         GUI.DrawTexture(new Rect(this.difference.x, this.difference.y, this.size.x, this.size.y), this.optionsTexture);
         GUI.EndGroup();
         GUI.depth = 1;
         GUI.BeginGroup(new Rect(this.difference.x, this.difference.y, this.size.x, this.size.y));
         GUI.skin.button.normal.background = this.menuTextures[0];
         GUI.skin.button.hover.background  = this.menuTextures[1];
         GUI.skin.button.active.background = this.menuTextures[0];
         if (GUI.Button(new Rect(this.menuTexturePos.x, this.menuTexturePos.y, this.menuTextureSize.x, this.menuTextureSize.y), string.Empty))
         {
             this.options   = false;
             this.mouseDown = false;
         }
         if (this.unset)
         {
             this.mouseSensitivity               = GameObject.FindGameObjectWithTag("Audio").GetComponent <MyUnitySingleton>().mouseSensitivity;
             this.volume                         = GameObject.FindGameObjectWithTag("Audio").GetComponent <MyUnitySingleton>().volume;
             GUI.skin.toggle.normal.background   = this.checkBoxTextures[0];
             GUI.skin.toggle.hover.background    = this.checkBoxTextures[0];
             GUI.skin.toggle.active.background   = this.checkBoxTextures[1];
             GUI.skin.toggle.onNormal.background = this.checkBoxTextures[1];
             GUI.skin.toggle.onHover.background  = this.checkBoxTextures[1];
             GUI.skin.toggle.onActive.background = this.checkBoxTextures[0];
             this.unset = false;
         }
         GUI.DrawTexture(this.volumeRect, this.sliderBox);
         GUI.DrawTexture(this.mouseRect, this.sliderBox);
         this.saturated   = GUI.Toggle(new Rect(this.saturatedPos.x, this.saturatedPos.y, this.checkBoxSize.x, this.checkBoxSize.y), !this.unSaturated, string.Empty);
         this.unSaturated = GUI.Toggle(new Rect(this.deSaturatedPos.x, this.deSaturatedPos.y, this.checkBoxSize.x, this.checkBoxSize.y), !this.saturated, string.Empty);
         GUI.EndGroup();
         this.saturated = !this.unSaturated;
         if (base.GetComponentInChildren <ColorCorrectionEffect>())
         {
             base.GetComponentInChildren <ColorCorrectionEffect>().enabled = this.unSaturated;
         }
         if (GameObject.FindGameObjectWithTag("Playermesh"))
         {
             GameObject.FindGameObjectWithTag("Playermesh").GetComponent <AudioScripts>().volume = this.volume;
             base.GetComponent <MovementScripts>().mouseSensitivity = this.mouseSensitivity;
         }
         if (GameObject.FindGameObjectWithTag("Audio"))
         {
             GameObject.FindGameObjectWithTag("Audio").GetComponent <MyUnitySingleton>().volume           = this.volume;
             GameObject.FindGameObjectWithTag("Audio").GetComponent <MyUnitySingleton>().mouseSensitivity = this.mouseSensitivity;
             GameObject.FindGameObjectWithTag("Audio").GetComponent <MyUnitySingleton>().saturated        = this.saturated;
         }
         GUI.skin.label.fontSize = 50;
         GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 1f);
         //GUI.Label(new Rect(50, 50, Screen.width, Screen.height), new GUIContent("TEST LABEL -- this.options == true"));
         this.selectSplits.DrawSelectSplitsFromMiddleCenter(Screen.width / 2, MenuComponentSelectSplits.OptionsMenuYPos * scale.y);
         GUIHelpers.DrawSpeedyTex(new Rect(50f * scale.x, 50f * scale.y, speedyTexWidth * scale.x, speedyTexWidth / 2 * scale.y), GUIHelpers.EaseOutBounce, easeScaleCloserTo1: 0.4f);
         GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, this.startFadeValue);
     }
     if (this.credits && this.mouseDown)
     {
         this.credits   = false;
         this.mouseDown = false;
     }
     GUI.skin.label.fontSize = 50;
     //GUI.Label(new Rect(50, 100, Screen.width, Screen.height), new GUIContent("TEST LABEL -- MenuScripts"));
 }