Exemplo n.º 1
0
    private void LogWindow(int windowID)
    {
        if (GUI.Button(new Rect(0f, 0f, (float)Screen.width * HiDebug._buttonWidth, (float)Screen.height * HiDebug._buttonHeight), "Clear", this.GetGUISkin(GUI.skin.button, Color.white, TextAnchor.MiddleCenter)))
        {
            this.logInfos.Clear();
            this._stackInfo = null;
        }
        if (GUI.Button(new Rect((float)Screen.width * (1f - HiDebug._buttonWidth), 0f, (float)Screen.width * HiDebug._buttonWidth, (float)Screen.height * HiDebug._buttonHeight), "Close", this.GetGUISkin(GUI.skin.button, Color.white, TextAnchor.MiddleCenter)))
        {
            this._eDisplay = HiDebug.EDisplay.Button;
        }


        int top = GUI.skin.window.padding.top;

        GUIStyle gUISkin = this.GetGUISkin(GUI.skin.toggle, Color.white, TextAnchor.UpperLeft);

        this._isLogOn = GUI.Toggle(new Rect((float)Screen.width * HiDebug._buttonWidth * 1.2f, (float)top, (float)Screen.width * HiDebug._buttonWidth, (float)Screen.height * HiDebug._buttonHeight - (float)top), this._isLogOn, "Log", gUISkin);

        GUIStyle gUISkin2 = this.GetGUISkin(GUI.skin.toggle, Color.yellow, TextAnchor.UpperLeft);

        this._isWarnningOn = GUI.Toggle(new Rect((float)Screen.width * HiDebug._buttonWidth * 2f, (float)top, (float)Screen.width * HiDebug._buttonWidth, (float)Screen.height * HiDebug._buttonHeight - (float)top), this._isWarnningOn, "Warnning", gUISkin2);

        GUIStyle gUISkin3 = this.GetGUISkin(GUI.skin.toggle, Color.red, TextAnchor.UpperLeft);

        this._isErrorOn = GUI.Toggle(new Rect((float)Screen.width * HiDebug._buttonWidth * 3.1f, (float)top, (float)Screen.width * HiDebug._buttonWidth, (float)Screen.height * HiDebug._buttonHeight - (float)top), this._isErrorOn, "Error", gUISkin3);

        GUILayout.Space((float)Screen.height * HiDebug._buttonHeight - (float)top);

        this._scrollLogPosition = GUILayout.BeginScrollView(this._scrollLogPosition, new GUILayoutOption[0]);
        this.LogItem();
        GUILayout.EndScrollView();
    }
Exemplo n.º 2
0
    private void Button()
    {
        if (this._eDisplay != HiDebug.EDisplay.Button)
        {
            return;
        }

        if (this._rect.Contains(Event.current.mousePosition))
        {
            if (Event.current.type == EventType.mouseDown)
            {
                this._eMouse        = HiDebug.EMouse.Down;
                this._mouseDownTime = Time.realtimeSinceStartup;
            }

            else if (Event.current.type == EventType.mouseUp)
            {
                this._eMouse = HiDebug.EMouse.Up;
                if (Time.realtimeSinceStartup - this._mouseDownTime < this._mouseClickTime)
                {
                    this._eDisplay = HiDebug.EDisplay.Panel;
                }
            }
        }
        if (this._eMouse == HiDebug.EMouse.Down && Event.current.type == EventType.mouseDrag)
        {
            this._rect.x = Event.current.mousePosition.x - this._rect.width / 2f;
            this._rect.y = Event.current.mousePosition.y - this._rect.height / 2f;
        }

        GUI.Button(this._rect, "On", this.GetGUISkin(GUI.skin.button, Color.white, TextAnchor.MiddleCenter));
    }