protected override OdinMenuTree BuildMenuTree() { OdinMenuTree tree = new OdinMenuTree(true); tree.DefaultMenuStyle = OdinMenuStyle.TreeViewStyle; tree.Config.DrawSearchToolbar = true; //tree.Add("Menu Style", tree.DefaultMenuStyle, EditorIcons.SettingsCog); tree.Add("Game Master", GameMaster.Get(), EditorIcons.PacmanGhost); tree.AddAllAssetsAtPath("Data", "Assets/Data", typeof(IntValue), true).AddThumbnailIcons(); tree.AddAllAssetsAtPath("Data", "Assets/Data", typeof(FloatValue), true).AddThumbnailIcons(); tree.AddAllAssetsAtPath("Data", "Assets/Data", typeof(HeartsValue), true).AddThumbnailIcons(); tree.AddAllAssetsAtPath("Data", "Assets/Data", typeof(DynamicsProfile), true).AddThumbnailIcons(); tree.Add("Audio", null, EditorIcons.Sound); tree.AddAllAssetsAtPath("Audio", "Assets/Audio/Audio Collections", typeof(AudioCollection), true).AddThumbnailIcons(); tree.Add("Save Data", null, EditorIcons.GridBlocks); BuildSaveDataTree <string>(tree, "StringValue"); BuildSaveDataTree <int>(tree, "IntValue"); BuildSaveDataTree <float>(tree, "FloatValue"); BuildSaveDataTree <bool>(tree, "BoolValue"); BuildSaveDataTree <Hearts>(tree, "HeartsValue"); BuildSaveDataTree <bool>(tree, "ConstellationData"); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(true); tree.DefaultMenuStyle.IconSize = 28.00f; //图标大小 tree.Config.DrawSearchToolbar = true; //搜索栏 //角色预览页 MonsterOverview.Instance.UpdataMonsterOverview(); tree.Add("Monsters", new MonsterTable(MonsterOverview.Instance.AllMonsters)); //增加所有角色到左边 tree.AddAllAssetsAtPath("Resources/ScriptsObject/MonsterSet", "Assets", typeof(MonsterSet), true, true); //添加所有的模块到左边 tree.AddAllAssetsAtPath("Resources/ScriptsObject/ModuleSet", "Assets", typeof(ModuleSet), true, true); //拖拽功能 tree.EnumerateTree().Where(x => x.Value as ModuleSet).ForEach(AddDragHandles); //添加所有的技能到左边 tree.AddAllAssetsAtPath("Resources/ScriptsObject/SkillSet", "Assets", typeof(SkillSet), true, true); //拖拽功能 tree.EnumerateTree().Where(x => x.Value as SkillSet).ForEach(AddDragHandles); //添加图标 tree.EnumerateTree().AddIcons <MonsterSet>(x => x.monsterIcon); tree.EnumerateTree().AddIcons <ModuleSet>(x => x.moduleIconA); tree.EnumerateTree().AddIcons <SkillSet>(x => x.skillIconA); return(tree); }
//I'm building multiple trees depending on what "state" is selected protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); tree.Selection.SupportsMultiSelect = false; switch (managerState) { case ManagerState.modules: tree.AddAllAssetsAtPath("Module Data", modulePath, typeof(ModuleData)); break; case ManagerState.Items: tree.AddAllAssetsAtPath("Item Data", itemPath, typeof(OpenInventory.ItemData)); break; case ManagerState.Recipes: tree.AddAllAssetsAtPath("Reciped", recipePath, typeof(RecipeBase)); break; case ManagerState.color: tree.AddAllAssetsAtPath("Color Data", colorPath, typeof(ColorData)); break; default: break; } return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(true); tree.DefaultMenuStyle.IconSize = 28.00f; tree.Config.DrawSearchToolbar = true; // Adds the character overview table. CharacterOverview.Instance.UpdateCharacterOverview(); tree.Add("Characters", new CharacterTable(CharacterOverview.Instance.AllCharacters)); // Adds all cahracters. tree.AddAllAssetsAtPath("Characters", "Assets/Plugins/Sirenix", typeof(Character), true, true); // Add all scriptable object items. tree.AddAllAssetsAtPath("", "Assets/Plugins/Sirenix/Demos/SAMPLE - RPG Editor/Items", typeof(Item), true) .ForEach(this.AddDragHandles); // Add drag handles to items, so they can be easily dragged into the inventory if characters etc... tree.EnumerateTree().Where(x => x.Value as Item).ForEach(AddDragHandles); // Add icons to characters and items. tree.EnumerateTree().AddIcons <Character>(x => x.Icon); tree.EnumerateTree().AddIcons <Item>(x => x.Icon); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(true); var customMenuStyle = new OdinMenuStyle { BorderPadding = 0f, AlignTriangleLeft = true, TriangleSize = 16f, TrianglePadding = 0f, Offset = 20f, Height = 23, IconPadding = 0f, BorderAlpha = 0.323f }; tree.DefaultMenuStyle = customMenuStyle; tree.Config.DrawSearchToolbar = true; // Adds the custom menu style to the tree, so that you can play around with it. // Once you are happy, you can press Copy C# Snippet copy its settings and paste it in code. // And remove the "Menu Style" menu item from the tree. tree.AddObjectAtPath("Menu Style", tree.DefaultMenuStyle) .AddThumbnailIcons(); for (int i = 0; i < 5; i++) { var customObject = new SomeCustomClass() { Name = i.ToString() }; var customMenuItem = new MyCustomMenuItem(tree, customObject); tree.AddMenuItemAtPath("Custom Menu Items", customMenuItem); } tree.AddAllAssetsAtPath("Scriptable Objects in Plugins Tree", "Plugins", typeof(ScriptableObject), true, false) .AddThumbnailIcons() .SortMenuItemsByName(); tree.AddAllAssetsAtPath("Scriptable Objects in Plugins Flat", "Plugins", typeof(ScriptableObject), true, true) .AddThumbnailIcons(true) .SortMenuItemsByName(); tree.AddAllAssetsAtPath("Only Configs has Icons", "Plugins/Sirenix", true, false) .Where(x => x.ObjectInstance as ScriptableObject) .AddThumbnailIcons(); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(true); tree.DefaultMenuStyle = CaomaoGUIStyle.DefaultMenuStyle; tree.Config.DrawSearchToolbar = true; tree.AddObjectAtPath("本地化操作", this.operatorIns); tree.AddAllAssetsAtPath("本地化ScriptableObject文件", this.operatorIns.SBFolderPath, true, false); tree.AddAllAssetsAtPath("本地化Excel文件", this.operatorIns.ExcelFolderPath, true, false); tree.AddAssetAtPath("脚本常量模板", this.operatorIns.TemplateFilePath); tree.EnumerateTree().AddThumbnailIcons(); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); tree.Selection.SupportsMultiSelect = false; tree.Add("Settings", GeneralDrawerConfig.Instance); tree.Add("Utilities", new TextureUtilityEditor()); tree.Add("Utilities/MyStruct", new MyStruct()); tree.AddAllAssetsAtPath("Odin Settings", "", typeof(ScriptableObject), true, true); return(tree); var tree2 = new OdinMenuTree(); tree2.DefaultMenuStyle = OdinMenuStyle.TreeViewStyle; tree2.Add("Menu Style", tree2.DefaultMenuStyle); var allAssets = AssetDatabase.GetAllAssetPaths() .Where(x => x.StartsWith("Assets/")) .OrderBy(x => x); foreach (var path in allAssets) { tree2.AddAssetAtPath(path.Substring("Assets/".Length), path); } tree2.EnumerateTree().AddThumbnailIcons(); return(tree2); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); tree.DefaultMenuStyle = OdinMenuStyle.TreeViewStyle; // tree.Add("Menu Style", tree.DefaultMenuStyle); tree.Selection.SupportsMultiSelect = false; tree.Add("AB管理", new ABManager()); tree.Add("DLL管理", new DLLManager()); tree.Add("Manifest", AssetDatabase.LoadAssetAtPath <UnityEngine.Object>("Assets/Manifest.asset")); tree.Add("配置", Resources.Load <LWGlobalConfig>("LWGlobalConfig")); tree.Add("其他", new OtherToolManger()); tree.AddAllAssetsAtPath("序列化文件", "Assets/LWFramework/Editor", typeof(ScriptableObject), true, true); //var allAssets = AssetDatabase.GetAllAssetPaths() // .Where(x => x.StartsWith("Assets/")) // .OrderBy(x => x); //foreach (var path in allAssets) //{ // tree.AddAssetAtPath(path.Substring("Assets/".Length), path); //} tree.EnumerateTree().AddThumbnailIcons(); return(tree); }
protected override OdinMenuTree BuildMenuTree() { createNewEnemy = new CreateNewEnemy(); var tree = new OdinMenuTree(supportsMultiSelect: true) { { "Create New/Enemy", createNewEnemy } }; tree.AddAllAssetsAtPath("Party Members", "Scriptable Objects/Characters/Party Members", typeof(PartyMember)); tree.AddAllAssetsAtPath("Enemies", "Scriptable Objects/Characters/Enemies", typeof(Enemy)); tree.AddAllAssetsAtPath("", "Resources", typeof(PartyManager)); tree.AddAllAssetsAtPath("", "Resources", typeof(EnemyManager)); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var setting = GetOrCreateSetting(); OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true) { { "Setting", setting }, }; var paths = setting.AssetPaths; for (int i = 0; i < paths.Count; i++) { if (paths[i].AssetPath != string.Empty) { tree.AddAssetAtPath(paths[i].Name, paths[i].AssetPath); } if (paths[i].FolderPath != string.Empty) { tree.AddAllAssetsAtPath(paths[i].Name, paths[i].FolderPath, typeof(ScriptableObject), true); } } tree.EnumerateTree().AddIcons <IGetIcon>(x => x.GetIcon()); tree.DefaultMenuStyle.IconSize = 34f; tree.DefaultMenuStyle.IconPadding = 0f; tree.DefaultMenuStyle.SetIconOffset(-5f); tree.DefaultMenuStyle.SetOffset(5f); tree.Config.DrawSearchToolbar = true; return(tree); }
private SomeData someData = new SomeData(); // Take a look at SomeData to see how serialization works in Editor Windows. protected override OdinMenuTree BuildMenuTree() { OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true) { { "Home", this, EditorIcons.House }, // draws the someDataField in this case. { "Odin Settings", null, EditorIcons.SettingsCog }, { "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"); tree.MenuItems.Insert(2, new OdinMenuItem(tree, "Menu Style", tree.DefaultMenuStyle)); 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 override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(true); tree.AddAllAssetsAtPath("", "Resources", typeof(GlobalVariables)).AddIcon(EditorIcons.SettingsCog); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(true); tree.DefaultMenuStyle.IconSize = 28.00f; tree.Config.DrawSearchToolbar = true; tree.AddAllAssetsAtPath("LoadBuff", "Assets/Editor/BuffEditor/Buff", typeof(CSBuff), true, true); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); tree.Selection.SupportsMultiSelect = false; tree.Add("Create New", new CreateNewEnemyData()); tree.AddAllAssetsAtPath("Enemy Data", "Assets/Scripts", typeof(EnemyData)); return(tree); }
protected override OdinMenuTree BuildMenuTree() { createNewClass = new CreateNewClass(); createNewWeapon = new CreateNewWeapon(); var tree = new OdinMenuTree(supportsMultiSelect: true) { { "Create New/Class", createNewClass }, { "Create New/Weapon", createNewWeapon } }; tree.AddAllAssetsAtPath("Classes/Alek", "Scriptable Objects/Classes/Alek Ezana", typeof(Class)); tree.AddAllAssetsAtPath("Classes/Leandra", "Scriptable Objects/Classes/Leandra Valentina", typeof(Class)); tree.AddAllAssetsAtPath("Classes/Lilith", "Scriptable Objects/Classes/Lilith Morana", typeof(Class)); tree.AddAllAssetsAtPath("Classes/Elias", "Scriptable Objects/Classes/Elias Adwin", typeof(Class)); tree.AddAllAssetsAtPath("Weapons", "Scriptable Objects/Weapons", typeof(WeaponItem)); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); tree.Selection.SupportsMultiSelect = false; tree.Add("+ Create New Enemy", new CreateNewEnemyData()); tree.AddAllAssetsAtPath("Enemy Data", ENEMY_DATA_FILEPATH, typeof(EnemySO)); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); createNewNPC = new CreateNewNPC(); tree.Add("Create NPC", createNewNPC); tree.AddAllAssetsAtPath("NPC Data", "Assets/Resources/NPC/NPC Data", typeof(NPCData)); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); _createNewWaveManager = new CreateNewWaveManager(); tree.Add("Create New Wave Manager", new CreateNewWaveManager()); tree.AddAllAssetsAtPath("Wave Manager", "Assets/Wave Managers", typeof(WaveManagerScriptableObject)); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); tree.Selection.SupportsMultiSelect = false; tree.Add("+ Create New Item", new CreateNewItemData()); tree.AddAllAssetsAtPath("Item Data", ITEM_DATA_FILEPATH, typeof(SOFabricatorItem)); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); if (CurrentModule != null && !CurrentModule.IsSceneObject) { tree.AddAllAssetsAtPath(CurrentModule.Label, CurrentModule.AssetsPath, CurrentModule.Type); } return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); _createNewSceneEssentials = new CreateNewSceneEssentials(); tree.Add("Create New Scene Type", _createNewSceneEssentials); tree.AddAllAssetsAtPath("Scene Essentials", "Assets/Resources/Tools/SceneEssentials", typeof(SceneEssentialObjects)); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); tree.Selection.SupportsMultiSelect = false; tree.Add("Settings", GeneralDrawerConfig.Instance); tree.Add("Utilities", new TextureUtilityEditor()); tree.AddAllAssetsAtPath("Odin Settings", "Assets/Plugins/Sirenix", typeof(ScriptableObject), true, true); return(tree); }
protected override OdinMenuTree BuildMenuTree() { OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true) { }; tree.AddAssetAtPath("Build", "Configs/Editor/Build/Build.asset"); tree.AddAllAssetsAtPath("", "", typeof(BuildSteps_Config), includeSubDirectories: true, flattenSubDirectories: true) .AddThumbnailIcons(); return(tree); }
protected override OdinMenuTree BuildMenuTree() { OdinMenuTree tree = new OdinMenuTree(supportsMultiSelect: true) { }; tree.AddAllAssetsAtPath("配置表", ScriptObjectConfig, typeof(ScriptObjectConfig), true, true) .AddThumbnailIcons(); tree.AddAllAssetsAtPath("数据创建器", ScriptObjectCreator, typeof(DataCreator), true, true) .AddThumbnailIcons(); tree.AddAllAssetsAtPath("数据", ScriptObjectData, typeof(CharacterBaseData), true, true) .AddThumbnailIcons(); tree.AddAllAssetsAtPath("组件", ComponentPath, typeof(ComponentManager), true, true) .AddThumbnailIcons(); tree.AddAllAssetsAtPath("组件列表", ComponentInfoPath, typeof(ComponentInfo), true, true) .AddThumbnailIcons(); return(tree); }
protected override OdinMenuTree BuildMenuTree() { createNewPhysicalAttack = new CreateNewPhysicalAttack(); createNewRangedAttack = new CreateNewRangedAttack(); createNewNonAttack = new CreateNewNonAttack(); createNewSpell = new CreateNewSpell(); createNewPassiveAbility = new CreateNewPassiveAbility(); var tree = new OdinMenuTree(supportsMultiSelect: true) { { "Create New/Ability/Physical Attack", createNewPhysicalAttack }, { "Create New/Ability/Ranged Attack", createNewRangedAttack }, { "Create New/Ability/Non-Attack", createNewNonAttack }, { "Create New/Passive Ability", createNewPassiveAbility }, { "Create New/Spell", createNewSpell } }; tree.AddAllAssetsAtPath("Abilities/Physical Attacks", "Scriptable Objects/Abilities/Physical", typeof(Ability)); tree.AddAllAssetsAtPath("Abilities/Ranged Attacks", "Scriptable Objects/Abilities/Ranged", typeof(Ability)); tree.AddAllAssetsAtPath("Abilities/Non-Attacks", "Scriptable Objects/Abilities/Non-attacks", typeof(Ability)); tree.AddAllAssetsAtPath("Abilities/Special Attacks", "Scriptable Objects/Abilities/Special Attacks", typeof(Ability)); tree.AddAllAssetsAtPath("Passive Abilities", "Scriptable Objects/Passive Abilities", typeof(PassiveAbility)); tree.AddAllAssetsAtPath("Spells", "Scriptable Objects/Spells", typeof(Spell)); return(tree); }
protected override OdinMenuTree BuildMenuTree() { OdinMenuTree tree = new OdinMenuTree { { "Path Settings", FindPathSettings() } }; tree.AddAllAssetsAtPath("Path Settings", "Assets/Continuous Mode/Data/Path Zones", typeof(ProceduralZone)); //tree.AddRange(ProceduralPathSettings.Instance.Zones, (obj) => ("Path Settings/Zone " + ProceduralPathSettings.Instance.Zones.Count)); tree.SortMenuItemsByName(); //tree. return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(true); tree.DefaultMenuStyle.IconSize = 28.00f; tree.Config.DrawSearchToolbar = true; tree.Add("Overview", new AllEquipment()); tree.Add("Loadouts", new Loadouts()); tree.AddAllAssetsAtPath("Frames", "Assets/Resources/Equipment/Frames/", typeof(Frame), true, true) .SortMenuItemsByName() .ForEach(this.AddDragHandles); tree.AddAllAssetsAtPath("Weapons/Main Weapons", "Assets/Resources/Equipment/Weapons/", typeof(MainWeapon), true, true) .SortMenuItemsByName() .ForEach(this.AddDragHandles); tree.AddAllAssetsAtPath("Weapons/Sub Weapons", "Assets/Resources/Equipment/Weapons/", typeof(SubWeapon), true) .SortMenuItemsByName() .ForEach(this.AddDragHandles); tree.AddAllAssetsAtPath("Mods", "Assets/Resources/Equipment/Mods/", typeof(Mod), true) .SortMenuItemsByName() .ForEach(this.AddDragHandles); // Add icons to characters and items. // tree.EnumerateTree().AddIcons<Character>(x => x.Icon); // tree.EnumerateTree().AddIcons<Item>(x => x.Icon); // Add drag handles to items, so they can be easily dragged into the inventory if characters etc... tree.EnumerateTree().Where(x => x.ObjectInstance as Equipment) .ForEach(AddDragHandles); return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); tree.Selection.SupportsMultiSelect = false; tree.Add("Create New", new CreateNewCharcacterData()); tree.AddAllAssetsAtPath("Enemy Data", "Assets/Scripts/2D Character Creator/Characters", typeof(CharacterSpriteData)); if (sprites != null) { tree.Add("Set Up Sprites", sprites); } return(tree); }
//I'm building multiple trees depending on what "state" is selected protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(); tree.Selection.SupportsMultiSelect = false; switch (managerState) { case ManagerState.Levels: tree.AddAllAssetsAtPath("Levels Data", levelsPath, typeof(LevelData)); break; default: break; } return(tree); }
protected override OdinMenuTree BuildMenuTree() { var tree = new OdinMenuTree(false); tree.DefaultMenuStyle.IconSize = 28.00f; tree.Config.DrawSearchToolbar = true; tree.Add("NPCS", null); tree.Add("NPCS/None", null); //If you decide to use the DialogueEditorSettings, you can use it as such, after you Create one //tree.AddAllAssetsAtPath("NPCS",DialogueEditorSettings.instance.NPCPath,typeof(NPCDialogue),true); try { //Try to avoid null ref exception tree.AddAllAssetsAtPath("NPCS", "", typeof(NPCDialogue), true); tree.EnumerateTree().AddIcons <NPCDialogue>(x => x.icon); } catch { } return(tree); }