Ejemplo n.º 1
0
    private Move AddMove()
    {
        Move moveHolder = null;

        ScriptableObjectCreator.ShowDialog <Move>("Assets/[Source]/Prefabs/Moves", obj =>
        {
            moveHolder = obj;
        });

        return(moveHolder);
    }
Ejemplo n.º 2
0
    protected override void OnBeginDrawEditors()
    {
        var selected      = this.MenuTree.Selection.FirstOrDefault();
        var toolbarHeight = this.MenuTree.Config.SearchToolbarHeight;

        SirenixEditorGUI.BeginHorizontalToolbar(toolbarHeight);
        {
            if (selected != null)
            {
                GUILayout.Label(selected.Name);
            }

            if (SirenixEditorGUI.ToolbarButton(new GUIContent("创建模组")))
            {
                ScriptableObjectCreator.ShowDialog <ModuleSet>("Assets/Resources/ScriptObject/ModuleSet", obj =>
                {
                    obj.moduleName = obj.name;
                    base.TrySelectMenuItemWithObject(obj); // Selects the newly created item in the editor
                });
            }

            if (SirenixEditorGUI.ToolbarButton(new GUIContent("创建怪物")))
            {
                ScriptableObjectCreator.ShowDialog <MonsterSet>("Assets/Resources/ScriptObject/MonsterSet", obj =>
                {
                    obj.monsterSpecificName = obj.name;
                    base.TrySelectMenuItemWithObject(obj); // Selects the newly created item in the editor
                });
            }
            if (SirenixEditorGUI.ToolbarButton(new GUIContent("创建技能")))
            {
                ScriptableObjectCreator.ShowDialog <SkillSet>("Assets/Resources/ScriptObject/SkillSet", obj =>
                {
                    obj.skillName = obj.name;
                    base.TrySelectMenuItemWithObject(obj); // Selects the newly created item in the editor
                });
            }
        }
        SirenixEditorGUI.EndHorizontalToolbar();
    }
Ejemplo n.º 3
0
    protected override void OnBeginDrawEditors()
    {
        var selected      = this.MenuTree.Selection.FirstOrDefault();
        var toolbarHeight = this.MenuTree.Config.SearchToolbarHeight;

        // Draws a toolbar with the name of the currently selected menu item.
        SirenixEditorGUI.BeginHorizontalToolbar(toolbarHeight);
        {
            if (selected != null)
            {
                GUILayout.Label(selected.Name);
            }

            if (SirenixEditorGUI.ToolbarButton(new GUIContent("Create Buff Item")))
            {
                ScriptableObjectCreator.ShowDialog <CSBuff>("Assets/Editor/BuffEditor/Buff",
                                                            obj =>
                {
                    base.TrySelectMenuItemWithObject(obj);     // Selects the newly created item in the editor
                });
            }
        }
        SirenixEditorGUI.EndHorizontalToolbar();
    }