private void Button() { if (this._eDisplay == EDisplay.Button) { if (this._rect.Contains(Event.current.mousePosition)) { if (Event.current.type == EventType.MouseDown) { this._eMouse = EMouse.Down; this._mouseDownTime = Time.realtimeSinceStartup; } else if (Event.current.type == EventType.MouseUp) { this._eMouse = EMouse.Up; if ((Time.realtimeSinceStartup - this._mouseDownTime) < this._mouseClickTime) { this._eDisplay = EDisplay.Panel; } } } if ((this._eMouse == 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)); } }
private void LogWindow(int windowID) { if (GUI.Button(new Rect(0f, 0f, Screen.width * _buttonWidth, Screen.height * _buttonHeight), "Clear", this.GetGUISkin(GUI.skin.button, Color.white, TextAnchor.MiddleCenter))) { this.logInfos.Clear(); this._stackInfo = null; } if (GUI.Button(new Rect(Screen.width * (1f - _buttonWidth), 0f, Screen.width * _buttonWidth, Screen.height * _buttonHeight), "Close", this.GetGUISkin(GUI.skin.button, Color.white, TextAnchor.MiddleCenter))) { this._eDisplay = EDisplay.Button; } int top = GUI.skin.window.padding.top; GUIStyle style = this.GetGUISkin(GUI.skin.toggle, Color.white, TextAnchor.UpperLeft); this._isLogOn = GUI.Toggle(new Rect(Screen.width * 0.3f, (float)top, Screen.width * _buttonWidth, (Screen.height * _buttonHeight) - top), this._isLogOn, "Log", style); GUIStyle style2 = this.GetGUISkin(GUI.skin.toggle, Color.yellow, TextAnchor.UpperLeft); this._isWarnningOn = GUI.Toggle(new Rect(Screen.width * 0.5f, (float)top, Screen.width * _buttonWidth, (Screen.height * _buttonHeight) - top), this._isWarnningOn, "Warnning", style2); GUIStyle style3 = this.GetGUISkin(GUI.skin.toggle, Color.red, TextAnchor.UpperLeft); this._isErrorOn = GUI.Toggle(new Rect(Screen.width * 0.7f, (float)top, Screen.width * _buttonWidth, (Screen.height * _buttonHeight) - top), this._isErrorOn, "Error", style3); GUILayout.Space((Screen.height * _buttonHeight) - top); this._scrollLogPosition = GUILayout.BeginScrollView(this._scrollLogPosition, new GUILayoutOption[0]); this.LogItem(); GUILayout.EndScrollView(); }
/// <summary> /// 重载的构造函数 /// </summary> /// <param name="page"></param> /// <param name="eDisplayType">显示的样式</param> public Validate(EDisplay displayType) { this.vPage = (System.Web.UI.Page)HttpContext.Current.Handler; this.eDisplayType = displayType; errorMessage = new StringBuilder(); }
/// <summary> /// ���صĹ��캯�� /// </summary> /// <param name="page"></param> /// <param name="eDisplayType">��ʾ����ʽ</param> public Validate(EDisplay displayType) { this.vPage = (System.Web.UI.Page)HttpContext.Current.Handler; this.eDisplayType = displayType; errorMessage = new StringBuilder(); }