UnityEditor.GenericMenu.ShowAsContext C# (CSharp) Method

ShowAsContext() public method

public ShowAsContext ( ) : void
return void
        public void ShowAsContext()
        {
            if (Event.current != null)
            {
                this.DropDown(new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 0f, 0f));
            }
        }

Usage Example

 public void OnContextClick(int itemIndex)
 {
   GenericMenu genericMenu = new GenericMenu();
   genericMenu.AddItem(new GUIContent("Unexpose"), false, (GenericMenu.MenuFunction2) (data => this.Delete((int) data)), (object) itemIndex);
   genericMenu.AddItem(new GUIContent("Rename"), false, (GenericMenu.MenuFunction2) (data => this.m_ReorderableListWithRenameAndScrollView.BeginRename((int) data, 0.0f)), (object) itemIndex);
   genericMenu.ShowAsContext();
 }
All Usage Examples Of UnityEditor.GenericMenu::ShowAsContext