Example #1
0
 public virtual void GoToCreditsScreen()
 {
     UFE.StartCreditsScreen();
 }
Example #2
0
    void OnGUI()
    {
        // Small GUI code to make the 3 option menu
        GUI.skin = customSkin;

        if (optionsIsOpen)
        {
            GUI.enabled = false;
        }

        if (startingCharacterSelect)
        {
            GUI.color = new Color(1, 1, 1, (Mathf.PingPong(Time.time * 15, 1)) / 2);
        }
        if (GUI.Button(startButtonRect, "", startButtonStyle) && !startingCharacterSelect)
        {
            if (UFE.config.soundfx)
            {
                Camera.main.audio.PlayOneShot(selectSound);
            }
            Invoke("StartCharacterSelect", .5f);
            startingCharacterSelect = true;
        }
        GUI.color = Color.white;

        if (GUI.Button(optionsButtonRect, "", optionsButtonStyle) && !startingCharacterSelect)
        {
            if (UFE.config.soundfx)
            {
                Camera.main.audio.PlayOneShot(selectSound);
            }
            optionsIsOpen = true;
        }

        if (GUI.Button(creditsButtonRect, "", creditsButtonStyle) && !startingCharacterSelect)
        {
            if (UFE.config.soundfx)
            {
                Camera.main.audio.PlayOneShot(selectSound);
            }
            UFE.StartCreditsScreen(2);
        }
        GUI.enabled = true;

        if (optionsIsOpen)
        {
            GUI.BeginGroup(new Rect(Screen.width / 2 - 200, Screen.height / 2 - 130, 400, 220)); {
                GUI.Box(new Rect(0, 0, 400, 220), "Options");
                GUI.BeginGroup(new Rect(15, 0, 380, 220)); {
                    GUILayoutUtility.GetRect(1, 45);

                    GUILayout.BeginHorizontal(); {
                        GUILayout.Label("Music", GUILayout.Width(240));
                        if (UFE.GetMusic())
                        {
                            if (GUILayout.Button("On", GUILayout.Width(120)))
                            {
                                UFE.SetMusic(false);
                            }
                        }
                        else
                        {
                            if (GUILayout.Button("Off", GUILayout.Width(120)))
                            {
                                UFE.SetMusic(true);
                            }
                        }
                    } GUILayout.EndHorizontal();

                    if (UFE.GetMusic())
                    {
                        GUILayout.BeginHorizontal(); {
                            GUILayout.Label("Music Volume", GUILayout.Width(240));
                            UFE.SetVolume(GUILayout.HorizontalSlider(UFE.GetVolume(), 0, 1, GUILayout.Width(120)));
                        } GUILayout.EndHorizontal();
                    }
                    else
                    {
                        GUILayoutUtility.GetRect(1, 34);
                    }

                    GUILayout.BeginHorizontal(); {
                        GUILayout.Label("Sound FX", GUILayout.Width(240));
                        if (UFE.GetSoundFX())
                        {
                            if (GUILayout.Button("On", GUILayout.Width(120)))
                            {
                                UFE.SetSoundFX(false);
                            }
                        }
                        else
                        {
                            if (GUILayout.Button("Off", GUILayout.Width(120)))
                            {
                                UFE.SetSoundFX(true);
                            }
                        }
                    } GUILayout.EndHorizontal();

                    GUILayoutUtility.GetRect(1, 40);
                    GUILayout.BeginHorizontal(); {
                        GUILayout.FlexibleSpace();
                        if (GUILayout.Button("Close"))
                        {
                            optionsIsOpen = false;
                        }
                        GUILayout.FlexibleSpace();
                    } GUILayout.EndHorizontal();
                } GUI.EndGroup();
            } GUI.EndGroup();
        }
    }