Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

GenericMenu.AddItem

AddItem(content: GUIContent, on: bool, func: MenuFunction): void;
void AddItem(GUIContent content, bool on, MenuFunction func);
def AddItem(content as GUIContent, on as bool, func as MenuFunction) as void

Description

Add an item to the menu.

AddItem(content: GUIContent, on: bool, func: MenuFunction2, userData: object): void;
void AddItem(GUIContent content, bool on, MenuFunction2 func, object userData);
def AddItem(content as GUIContent, on as bool, func as MenuFunction2, userData as object) as void

Description

Add an item to the menu.