Wanzyee Studio

Extension methods for UnityEditor.GenericMenu. More...

Static Public Member Functions

static void AddItem< T > (this GenericMenu menu, string content, Action< T > func, T param, bool check=false, bool enable=true)
 Add an item to the menu, it will be disabled if the function isn't assigned. More...
 
static void AddItem (this GenericMenu menu, string content, Action func=null, bool check=false, bool enable=true)
 Add an item to the menu, it will be disabled if the function isn't assigned. More...
 

Detailed Description

Extension methods for UnityEditor.GenericMenu.

3

Member Function Documentation

static void AddItem< T > ( this GenericMenu  menu,
string  content,
Action< T >  func,
param,
bool  check = false,
bool  enable = true 
)
static

Add an item to the menu, it will be disabled if the function isn't assigned.

Template Parameters
TThe parameter type.
Parameters
menuMenu.
contentContent.
funcThe function to call when the menu item is selected.
paramThe parameter to pass to the function.
checkWhether to show the item is currently activated.
enableIf set to false to enforce disabled.
static void AddItem ( this GenericMenu  menu,
string  content,
Action  func = null,
bool  check = false,
bool  enable = true 
)
static

Add an item to the menu, it will be disabled if the function isn't assigned.

Parameters
menuMenu.
contentContent.
funcThe function to call when the menu item is selected.
checkWhether to show the item is currently activated.
enableIf set to false to enforce disabled.