コード例 #1
0
ファイル: Kolonization_UI.cs プロジェクト: sh1pman/MKS
        private void GenerateWindow()
        {
            GUILayout.BeginVertical();
            try
            {
                //Global menu buttons
                GUILayout.BeginHorizontal();
                //Then based on that, toss up the appropriate content.
                if (GUIButton.LayoutButton(new GUIContent("Kolonization Level"), _buttonStyle, GUILayout.Width(145)))
                {
                    currentState = windowStates.KolonozationLevel;
                }
                if (GUIButton.LayoutButton(new GUIContent("Orbital Logistics"), _buttonStyle, GUILayout.Width(145)))
                {
                    currentState = windowStates.OrbitalLogistics;
                }
                if (GUIButton.LayoutButton(new GUIContent("Planetary Storage"), _buttonStyle, GUILayout.Width(145)))
                {
                    currentState = windowStates.PlanetaryStorage;
                }
                if (GUIButton.LayoutButton(new GUIContent("Kolony Statistics"), _buttonStyle, GUILayout.Width(145)))
                {
                    currentState = windowStates.KolonyStatistics;
                }
                if (GUIButton.LayoutButton(new GUIContent("X"), _buttonStyle, GUILayout.Width(30)))
                {
                    GuiOff();
                }
                GUILayout.EndHorizontal();

                scrollPos = GUILayout.BeginScrollView(scrollPos, _scrollStyle, GUILayout.Width(600), GUILayout.Height(350));
                GUILayout.BeginVertical();

                //Show our window
                switch (currentState)
                {
                case windowStates.KolonozationLevel:
                    DisplayKolonizationLevel();
                    break;

                case windowStates.KolonyStatistics:
                    break;

                case windowStates.OrbitalLogistics:
                    break;

                case windowStates.PlanetaryStorage:
                    break;
                }
            }
            catch (Exception ex)
            {
                Debug.Log(ex.StackTrace);
            }
            finally
            {
                GUILayout.EndVertical();
                GUILayout.EndScrollView();
                GUILayout.EndVertical();
                GUI.DragWindow();
            }
        }