private void WindowFunction(int windowID)
        {
            GUILayout.BeginHorizontal();
            {
                if (GUILayout.Button("Clear console"))
                {
                    TotalLog = "Log cleared";
                }
                if (GUILayout.Button("Dump scene"))
                {
                    SceneDumper.DumpScene();
                }

                LogUnity.Value = GUILayout.Toggle(LogUnity.Value, "Unity");
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginVertical(GUI.skin.box);
            {
                scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, true);
                {
                    GUILayout.BeginVertical();
                    {
                        GUILayout.FlexibleSpace();
                        GUILayout.TextArea(TotalLog, GUI.skin.label);
                    }
                    GUILayout.EndVertical();
                }
                GUILayout.EndScrollView();
            }
            GUILayout.EndVertical();

            GUI.DragWindow();
        }
Exemplo n.º 2
0
        private void WindowFunction(int windowID)
        {
            GUILayout.BeginHorizontal();
            {
                if (GUILayout.Button("Clear console"))
                {
                    TotalLog = "Log cleared";
                }
                if (GUILayout.Button("Dump scene"))
                {
                    SceneDumper.DumpScene();
                }

                LogUnity.Value = GUILayout.Toggle(LogUnity.Value, "Unity");
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginVertical(GUI.skin.box);
            {
                scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, true);
                {
                    GUILayout.BeginVertical();
                    {
                        GUILayout.FlexibleSpace();
                        logTextStyle.fontSize = fontSize.Value;
                        GUILayout.TextArea(TotalLog, logTextStyle);
                    }
                    GUILayout.EndVertical();
                }
                GUILayout.EndScrollView();
            }
            GUILayout.EndVertical();

            switch (Event.current.button)
            {
            case 0:    //Left mouse button window drag - move
                GUI.DragWindow();
                break;

            case 1:    //Right mouse button window drag - resize
                if (Event.current.type == EventType.MouseDrag)
                {
                    UI.width += Event.current.delta.x;
                }
                UI.height += Event.current.delta.y;
                break;
            }
        }