Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        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
        }