Namespace: | Sirenix.OdinInspector.Editor |
Assembly: | Sirenix.OdinInspector.Editor |
public abstract class OdinMenuEditorWindow : OdinEditorWindow, ISerializationCallbackReceiver
public class OdinMenuEditorWindowExample : OdinMenuEditorWindow
{
[SerializeField, HideLabel]
private SomeData someData = new SomeData();
protected override OdinMenuTree BuildMenuTree()
{
OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true)
{
{ "Home", this, EditorIcons.House }, // draws the someDataField in this case.
{ "Odin Settings", null, SdfIconType.GearFill },
{ "Odin Settings/Color Palettes", ColorPaletteManager.Instance, EditorIcons.EyeDropper },
{ "Odin Settings/AOT Generation", AOTGenerationConfig.Instance, EditorIcons.SmartPhone },
{ "Camera current", Camera.current },
{ "Some Class", this.someData }
};
tree.AddAllAssetsAtPath("More Odin Settings", SirenixAssetPaths.OdinEditorConfigsPath, typeof(ScriptableObject), true)
.AddThumbnailIcons();
tree.AddAssetAtPath("Odin Getting Started", SirenixAssetPaths.SirenixPluginPath + "Getting Started With Odin.asset");
var customMenuItem = new OdinMenuItem(tree, "Menu Style", tree.DefaultMenuStyle);
tree.MenuItems.Insert(2, customMenuItem);
tree.Add("Menu/Items/Are/Created/As/Needed", new GUIContent());
tree.Add("Menu/Items/Are/Created", new GUIContent("And can be overridden"));
// As you can see, Odin provides a few ways to quickly add editors / objects to your menu tree.
// The API also gives you full control over the selection, etc..
// Make sure to check out the API Documentation for OdinMenuEditorWindow, OdinMenuTree and OdinMenuItem for more information on what you can do!
return tree;
}
}
protected OdinMenuEditorWindow()
protected Color MenuBackgroundColor
public Func<OdinMenuItem, bool> CustomSearchFunction { get; set; }
public bool DrawMenuSearchBar { get; set; }
public OdinMenuTree MenuTree { get; }
public virtual float MenuWidth { get; set; }
public virtual bool ResizableMenuWidth { get; set; }
protected abstract OdinMenuTree BuildMenuTree()
OdinMenuTree |
protected virtual void DrawMenu()
public void ForceMenuTreeRebuild()
protected override IEnumerable<object> GetTargets()
System.Collections.Generic.IEnumerable<System.Object> |
protected override void OnDestroy()
protected override void OnImGUI()
public void TrySelectMenuItemWithObject(object obj)
System.Object | obj |