Ejemplo n.º 1
0
        private void OnGUI()
        {
            if (!Active)
            {
                return;
            }
            AllRect.ConsoleRect = GUILayout.Window(WindowID.CONSOLE, AllRect.ConsoleRect, (id) =>
            {
                GUILayout.BeginHorizontal();
                logBuffer.ShowLog     = GUILayout.Toggle(logBuffer.ShowLog, "Log");
                logBuffer.ShowWaring  = GUILayout.Toggle(logBuffer.ShowWaring, "Warning");
                logBuffer.ShowError   = GUILayout.Toggle(logBuffer.ShowError, "Error");
                logBuffer.WriteToFile = GUILayout.Toggle(logBuffer.WriteToFile, "Write2File");
                GUILayout.EndHorizontal();

                ScrollPosition = GUILayout.BeginScrollView(ScrollPosition);
                GUILayout.Label(logBuffer.ToString(), AllGUIStyle.DEFAULT_LABEL);
                GUILayout.EndScrollView();


                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Clr"))
                {
                    logBuffer.Clear();
                }
                if (GUILayout.Button("Close"))
                {
                    Active = false;
                }
                GUILayout.EndHorizontal();


                GUI.DragWindow(new Rect(0, 0, AllRect.ConsoleRect.width, 20));
            }, "Console", AllGUIStyle.DEFAULT_WINDOW);
        }