Example #1
0
 public static void ResetAllStatic()
 {
     RuntimeInspector.ResetStatic();
     NavigationCamera.ResetStatic();
     GUIChangeBool.ResetStatic();
     DrawEnum.ResetStatic();
     CullGroup.ResetStatic();
     HtmlDebug.ResetStatic();
 }
Example #2
0
        void OnGUI()
        {
            if (useCanvas)
            {
                InitCanvasRenderTexture();
            }

            BeginRenderTextureGUI(true);

            float guiScale = windowData.guiScale.value;

            GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(guiScale, guiScale, guiScale));
            Event currentEvent = Event.current;

            if (currentEvent.type == EventType.Layout)
            {
                GUIChangeBool.ApplyUpdates();
            }
            else
            {
                EventInput.GetInput();
            }

            if (runtimeInspector)
            {
                runtimeInspector.MyOnGUI();
            }
            if (runtimeConsole)
            {
                runtimeConsole.MyOnGUI();
            }

            if (DoWindowsContainMousePos())
            {
                eventHandling.OnEnter();
            }
            else
            {
                eventHandling.OnExit();
            }

            if (runtimeInspector)
            {
                if (runtimeInspector.windowData.showTooltip)
                {
                    DrawTooltip(EventInput.mousePos);
                }
            }

            GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, Vector3.one);

            EndRenderTextureGUI();
        }
        void Awake()
        {
#if !UNITY_EDITOR
            isDebugBuild = Debug.isDebugBuild;
#endif
            ResetStatic();
            consoleWindow = windowData.consoleWindow;

            logs      = new CullList[6];
            cullGroup = new CullGroup(logSize * logs.Length);

            for (int i = 0; i < logs.Length; i++)
            {
                logs[i] = new CullList(logSize);
            }

            SetActive(showConsoleOnStart);

            inputCommand = string.Empty;

            logs[commandLogs].cullItems.Add(new LogEntry("-------------------------------------------------------------------------------", Color.white, titleFontSize, FontStyle.Bold));
            logs[commandLogs].cullItems.Add(new LogEntry(Helper.GetApplicationInfo(), Color.white, titleFontSize, FontStyle.Bold));
            logs[commandLogs].cullItems.Add(new LogEntry("-------------------------------------------------------------------------------", Color.white, titleFontSize, FontStyle.Bold));
            logs[commandLogs].cullItems.Add(new LogEntry(string.Empty, Color.white, titleFontSize, FontStyle.Bold));
            logs[commandLogs].cullItems.Add(new LogEntry("Type '?' to list all commands", Color.white, titleFontSize, FontStyle.Bold));
            logs[commandLogs].cullItems.Add(new LogEntry(string.Empty, Color.white, titleFontSize, FontStyle.Bold));

            GUIChangeBool.ApplyUpdates();

            Register(this);

            CalcDraw(true);

#if UNITY_EDITOR
            if (testOnlyFreeConsoleCommands)
            {
                accessLevel = AccessLevel.Free;
            }
            else
            {
                accessLevel = AccessLevel.Admin;
            }
#else
            if (adminModeInBuild == AccessMode.Enabled)
            {
                accessLevel = AccessLevel.Admin;
            }
#endif
        }
Example #4
0
        public static bool DrawShowButton(SO_BaseWindow windowData, GUIContent content, GUIChangeBool show, Color color, float width = -1, bool onlyActivate = false)
        {
            if (show.Value)
            {
                GUI.backgroundColor = GetColor(windowData, color);
            }
            else
            {
                GUI.backgroundColor = GetColor(windowData, Color.grey);
            }

            bool clicked;

            if (width == -1)
            {
                clicked = GUILayout.Button(content, GUILayout.Height(20));
            }
            else
            {
                clicked = GUILayout.Button(content, GUILayout.Width(width), GUILayout.Height(20));
            }
            if (clicked)
            {
                if (onlyActivate)
                {
                    show.Value = true;
                }
                else
                {
                    show.Value = !show.Value;
                }
            }

            GUI.backgroundColor = GetColor(windowData, Color.white);
            GUI.color           = Color.white;

            return(clicked);
        }