void DrawLeftPane() { HGUIToolbar.Begin(); if (HGUIToolbar.Button(EditorIcon.refresh)) { Refresh(); EditorHelper.ShowMessagePop("Refresh OK."); } bool isDirty = m_treeView.m_asmdefItems.Where(x => x.isDIRTY).Count() != 0; ScopeDisable.Begin(!isDirty); if (HGUIToolbar.Button("Apply All")) { m_treeView.SaveAssetDirty(); } ScopeDisable.End(); if (HGUIToolbar.DropDown("Change Format")) { var m = new GenericMenu(); m.AddItem("Assembly Name", () => m_treeView.ChangeAsmName()); m.AddItem("GUID", () => m_treeView.ChangeGUID()); m.DropDownPopupRect(HEditorGUI.lastRect); // } GUILayout.FlexibleSpace(); HGUIToolbar.End(); m_treeView.DrawLayoutGUI(); }
public static void DropDownAtMousePosition(this GenericMenu menu) { if (Event.current == null) { return; } menu.DropDownPopupRect(new Rect(Event.current.mousePosition, new Vector2(0, 0))); }
public static Vector3 Vector3Field(Rect position, GUIContent content, Vector3 _value, params GUILayoutOption[] options) { var r = EditorGUI.PrefixLabel(position, content); //EditorGUI.DrawRect( , Color.black ); if (EditorHelper.HasMouseClick(position.W(r.x - EditorGUI.indentLevel * 16), EventMouseButton.R)) { var m = new GenericMenu(); m.AddItem(SharedModule.S._Copy, (context) => EditorHelper.MenuCopyPos((Vector3)context), _value); //m.AddItem( SharedModule.S._Paste, ( context ) => { // //ref Vector3 = (ref Vector3)context; // _value = EditorHelper.GetMenuPastePos(); //} ); m.DropDownPopupRect(position); } return(EditorGUI.Vector3Field(r, "", _value)); }
public bool UIDraw(Rect rect, P.Params currentParams) { EditorGUI.LabelField(rect, PB.i.GetSelectedPopupName(currentParams), EditorStyles.popup); if (EditorHelper.HasMouseClick(rect)) { void OnSelect(object context) { currentParams.buildSceneSetIndex = (int)context; P.Save(); } var m = new GenericMenu(); m.AddItem(S._UsethestandardBuildSettings, false, OnSelect, -1); m.AddSeparator(""); for (int idx = 0; idx < PB.i.profileList.Count; idx++) { var p = PB.i.profileList[idx]; m.AddItem(p.profileName, false, OnSelect, idx); } m.DropDownPopupRect(rect); } return(false); }
public static void DropDownLastRect(this GenericMenu menu) { menu.DropDownPopupRect(GUILayoutUtility.GetLastRect().PopupRect()); }