Namespace: | Sirenix.OdinInspector.Editor |
Assembly: | Sirenix.OdinInspector.Editor |
public static class OdinMenuTreeExtensions
OdinMenuTree tree = new OdinMenuTree();
tree.AddAllAssetsAtPath("Some Menu Item", "Some Asset Path", typeof(ScriptableObject), true)
.AddThumbnailIcons();
tree.AddAssetAtPath("Some Second Menu Item", "SomeAssetPath/SomeAssetFile.asset");
// etc...
public static IEnumerable<OdinMenuItem> AddAllAssetsAtPath(this OdinMenuTree tree, string menuPath, string assetFolderPath, bool includeSubDirectories = false, bool flattenSubDirectories = false)
OdinMenuTree | tree | The tree. |
System.String | menuPath | The menu item path. |
System.String | assetFolderPath | The asset folder path. |
System.Boolean | includeSubDirectories | Whether to search for assets in subdirectories as well. |
System.Boolean | flattenSubDirectories | If true, sub-directories in the assetFolderPath will no longer get its own sub-menu item at the specified menu item path. |
System.Collections.Generic.IEnumerable<OdinMenuItem> | Returns all menu items created in order to add the menu item at the specified menu item path. |
public static IEnumerable<OdinMenuItem> AddAllAssetsAtPath(this OdinMenuTree tree, string menuPath, string assetFolderPath, Type type, bool includeSubDirectories = false, bool flattenSubDirectories = false)
OdinMenuTree | tree | The tree. |
System.String | menuPath | The menu item path. |
System.String | assetFolderPath | The asset folder path. |
System.Type | type | The type. |
System.Boolean | includeSubDirectories | Whether to search for assets in subdirectories as well. |
System.Boolean | flattenSubDirectories | If true, sub-directories in the assetFolderPath will no longer get its own sub-menu item at the specified menu item path. |
System.Collections.Generic.IEnumerable<OdinMenuItem> | Returns all menu items created in order to add the menu item at the specified menu item path. |
public static IEnumerable<OdinMenuItem> AddAllAssetsAtPathCombined(this OdinMenuTree tree, string menuPath, string assetFolderPath, Type type, bool includeSubDirectories = false)
OdinMenuTree | tree | The tree. |
System.String | menuPath | The menu item path. |
System.String | assetFolderPath | The asset folder path. |
System.Type | type | The type of objects. |
System.Boolean | includeSubDirectories | Whether to search for assets in subdirectories as well. |
System.Collections.Generic.IEnumerable<OdinMenuItem> | Returns all menu items created in order to add the menu item at the specified menu item path. |
public static IEnumerable<OdinMenuItem> AddAssetAtPath(this OdinMenuTree tree, string menuItemPath, string assetPath)
OdinMenuTree | tree | The tree. |
System.String | menuItemPath | The menu item path. |
System.String | assetPath | The asset path. |
System.Collections.Generic.IEnumerable<OdinMenuItem> | Returns all menu items created in order to add the menu item at the specified menu item path. |
public static IEnumerable<OdinMenuItem> AddAssetAtPath(this OdinMenuTree tree, string menuItemPath, string assetPath, Type type)
OdinMenuTree | tree | The tree. |
System.String | menuItemPath | The menu item path. |
System.String | assetPath | The asset path. |
System.Type | type | The type. |
System.Collections.Generic.IEnumerable<OdinMenuItem> | Returns all menu items created in order to add the menu item at the specified menu item path. |
public static OdinMenuItem AddIcon(this OdinMenuItem menuItem, SdfIconType icon)
OdinMenuItem | menuItem | |
SdfIconType | icon |
OdinMenuItem |
public static IEnumerable<OdinMenuItem> AddIcon(this IEnumerable<OdinMenuItem> menuItems, EditorIcon icon)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
EditorIcon | icon |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> AddIcon(this IEnumerable<OdinMenuItem> menuItems, Sprite icon)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
UnityEngine.Sprite | icon |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> AddIcon(this IEnumerable<OdinMenuItem> menuItems, Texture icon)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
UnityEngine.Texture | icon |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> AddIcon(this IEnumerable<OdinMenuItem> menuItems, Texture icon, Texture iconSelected)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
UnityEngine.Texture | icon | |
UnityEngine.Texture | iconSelected |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> AddIcons(this IEnumerable<OdinMenuItem> menuItems, EditorIcon icon)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
EditorIcon | icon |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> AddIcons(this IEnumerable<OdinMenuItem> menuItems, Func<OdinMenuItem, Sprite> getIcon)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
System.Func<OdinMenuItem, UnityEngine.Sprite> | getIcon |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> AddIcons(this IEnumerable<OdinMenuItem> menuItems, Func<OdinMenuItem, Texture> getIcon)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
System.Func<OdinMenuItem, UnityEngine.Texture> | getIcon |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> AddIcons(this IEnumerable<OdinMenuItem> menuItems, Texture icon)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
UnityEngine.Texture | icon |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> AddIcons(this IEnumerable<OdinMenuItem> menuItems, Texture icon, Texture iconSelected)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
UnityEngine.Texture | icon | |
UnityEngine.Texture | iconSelected |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> AddIcons<T>(this IEnumerable<OdinMenuItem> menuItems, Func<T, Sprite> getIcon)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
System.Func<T, UnityEngine.Sprite> | getIcon |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
T |
public static IEnumerable<OdinMenuItem> AddIcons<T>(this IEnumerable<OdinMenuItem> menuItems, Func<T, Texture> getIcon)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
System.Func<T, UnityEngine.Texture> | getIcon |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
T |
public static void AddMenuItemAtPath(this OdinMenuTree tree, ICollection<OdinMenuItem> result, string path, OdinMenuItem menuItem)
OdinMenuTree | tree | The tree instance. |
System.Collections.Generic.ICollection<OdinMenuItem> | result | The result list. |
System.String | path | The menu item path. |
OdinMenuItem | menuItem | The menu item. |
public static IEnumerable<OdinMenuItem> AddMenuItemAtPath(this OdinMenuTree tree, string path, OdinMenuItem menuItem)
OdinMenuTree | tree | The tree. |
System.String | path | The menu item path. |
OdinMenuItem | menuItem | The menu item. |
System.Collections.Generic.IEnumerable<OdinMenuItem> | Returns all menu items created in order to add the menu item at the specified menu item path. |
public static IEnumerable<OdinMenuItem> AddObjectAtPath(this OdinMenuTree tree, string menuPath, object instance, bool forceShowOdinSerializedMembers = false)
OdinMenuTree | tree | The tree. |
System.String | menuPath | The menu path. |
System.Object | instance | The object instance. |
System.Boolean | forceShowOdinSerializedMembers | Set this to true if you want Odin serialzied members such as dictionaries and generics to be shown as well. |
System.Collections.Generic.IEnumerable<OdinMenuItem> | Returns all menu items created in order to add the menu item at the specified menu item path. |
public static OdinMenuItem AddThumbnailIcon(this OdinMenuItem item, bool preferAssetPreviewAsIcon)
OdinMenuItem | item | |
System.Boolean | preferAssetPreviewAsIcon |
OdinMenuItem |
public static IEnumerable<OdinMenuItem> AddThumbnailIcons(this IEnumerable<OdinMenuItem> menuItems, bool preferAssetPreviewAsIcon = false)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
System.Boolean | preferAssetPreviewAsIcon |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static void AssignIconToEmptyItems(this OdinMenuTree tree, SdfIconType icon, Color? iconColor = default(Color? ))
OdinMenuTree | tree | |
SdfIconType | icon | |
System.Nullable<UnityEngine.Color> | iconColor |
public static void AssignIconToItemsWithNone(this OdinMenuTree tree, SdfIconType icon, Color? iconColor = default(Color? ))
OdinMenuTree | tree | |
SdfIconType | icon | |
System.Nullable<UnityEngine.Color> | iconColor |
public static void CollapseEmptyItems(this OdinMenuTree tree)
OdinMenuTree | tree |
public static OdinMenuItem GetMenuItem(this OdinMenuTree tree, string menuPath)
OdinMenuTree | tree | |
System.String | menuPath |
OdinMenuItem |
public static IEnumerable<OdinMenuItem> SortMenuItemsByName(this OdinMenuTree tree, bool placeFoldersFirst = true)
OdinMenuTree | tree | |
System.Boolean | placeFoldersFirst |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> SortMenuItemsByName(this IEnumerable<OdinMenuItem> menuItems, bool placeFoldersFirst = true, bool ignoreLeadingZeroes = true, bool ignoreWhiteSpace = true, bool ignoreCase = false)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
System.Boolean | placeFoldersFirst | |
System.Boolean | ignoreLeadingZeroes | |
System.Boolean | ignoreWhiteSpace | |
System.Boolean | ignoreCase |
System.Collections.Generic.IEnumerable<OdinMenuItem> |
public static IEnumerable<OdinMenuItem> SortMenuItemsByName(this IEnumerable<OdinMenuItem> menuItems, Comparison<OdinMenuItem> comparison)
System.Collections.Generic.IEnumerable<OdinMenuItem> | menuItems | |
System.Comparison<OdinMenuItem> | comparison |
System.Collections.Generic.IEnumerable<OdinMenuItem> |