Ejemplo n.º 1
0
        static public void Display(string title, CustomStyle myStyle)
        {
            GUILayout.BeginHorizontal(myStyle.BacgDemos);
            if (buttonIconHome == null)
            {
                buttonIconHome = Resources.Load <Texture2D>("Textures/home");
            }
            if (buttonIconQuit == null)
            {
                buttonIconQuit = Resources.Load <Texture2D>("Textures/quit");
            }
            if (buttonIconMPTK == null)
            {
                buttonIconMPTK = Resources.Load <Texture2D>("Logo_MPTK");
            }

            if (GUILayout.Button(new GUIContent(buttonIconHome, "Go to main menu"), GUILayout.Width(60), GUILayout.Height(60)))
            {
                for (int i = 0; i < SceneManager.sceneCountInBuildSettings; i++)
                {
                    if (SceneUtility.GetScenePathByBuildIndex(i).Contains("ScenesDemonstration"))
                    {
                        MidiPlayerGlobal.MPTK_Stop();
                        SceneManager.LoadScene(i, LoadSceneMode.Single);
                        return;
                    }
                }
            }

            GUILayout.Space(20);
            GUILayout.Label(title, myStyle.TitleLabel1, GUILayout.Height(60));
            GUILayout.Space(20);

            if (GUILayout.Button(new GUIContent(buttonIconQuit, "Exit"), GUILayout.Width(60), GUILayout.Height(60)))
            {
                MidiPlayerGlobal.MPTK_Quit();
            }

            if (GUILayout.Button(new GUIContent(buttonIconMPTK, "Go to web site"), GUILayout.Width(60), GUILayout.Height(60)))
            {
                Application.OpenURL("https://paxstellar.fr/setup-mptk-quick-start-v2/");
            }
            GUILayout.EndHorizontal();
        }