Ejemplo n.º 1
0
 private void DrawContextMenu(StratusEditorUtility.ContextMenuType type, List <MenuOption> options)
 {
     if (options.NotEmpty())
     {
         var menu = new GenericMenu();
         foreach (var option in options)
         {
             menu.AddItem(option.content, false, option.menuFunction);
         }
         StratusEditorUtility.DrawContextMenu(menu, type);
     }
 }
Ejemplo n.º 2
0
 public void AddItem(string content, GenericMenu.MenuFunction menuFunction, StratusEditorUtility.ContextMenuType type)
 {
     this.AddItem(new GUIContent(content), menuFunction, type);
 }
Ejemplo n.º 3
0
        public void AddItem(GUIContent content, GenericMenu.MenuFunction menuFunction, StratusEditorUtility.ContextMenuType type)
        {
            MenuOption item = new MenuOption(content, menuFunction);

            switch (type)
            {
            case StratusEditorUtility.ContextMenuType.Add:
                addItems.Add(item);
                break;

            case StratusEditorUtility.ContextMenuType.Validation:
                validateItems.Add(item);
                break;

            case StratusEditorUtility.ContextMenuType.Options:
                optionItems.Add(item);
                break;
            }

            this.hasToolbar = true;
        }