private void OnGUI() { Event e = Event.current; if (e.isMouse && e.button == 0 && e.type == EventType.MouseDown) { GUI.FocusControl(""); } InitStyles(); // Toolbar Area Rect rect = new Rect(0f, 0f, position.width, m_Toolbar.fixedHeight); GUILayout.BeginArea(new Rect(0f, 0f, position.width, m_Toolbar.fixedHeight), m_Toolbar); GUILayout.BeginHorizontal(); GUILayout.Space(5f); TabArea(); GUILayout.Space(5f); GUILayout.EndHorizontal(); GUILayout.EndArea(); // Left Area Rect leftRect = new Rect(5f, rect.height + 5f, position.width - 10f, position.height - rect.height - 10f); GUILayout.BeginArea(leftRect); SelectEditorArea(new Rect(0f, 0f, leftRect.width, leftRect.height)); GUILayout.EndArea(); if (OnRepaint != null) { OnRepaint.Invoke(); } if (e.isMouse && e.button == 0 && e.type == EventType.MouseDown) { Repaint(); } }
/// <summary> /// /// Invoke OnRepaint event. /// /// </summary> protected void InvokeRepaint() { OnRepaint?.Invoke(this); }
private void HandleOnReset() { OnRepaint?.Invoke(this, EventArgs.Empty); }