class MAGES::SceneGraph::Editor::EditorExtension

Overview

A scene graph editor extension. More…

class EditorExtension
{
public:
    // properties

    SceneGraphView View;

    // methods

    virtual void OnInit();
    virtual void OnDestroy();
    virtual void OnBuildContextualMenu(ContextualMenuPopulateEvent evt);
    void AddElementToToolbar(VisualElement element);
    IActionImplementor AddAction< T >(out T data, Vector2? position = null);

    IActionImplementor AddAction(
        System.Type actionType,
        Vector2 position,
        out object data
    );

    VisualElement OpenPanel(
        string title,
        System.Action onClosed,
        System.Func canClose
    );
};

// direct descendants

class StoryboardImportExtension;

Detailed Documentation

A scene graph editor extension.

Properties

SceneGraphView View

Gets the scene graph view.

Methods

virtual void OnInit()

Called when the editor opens.

virtual void OnDestroy()

Called when the editor closes.

virtual void OnBuildContextualMenu(ContextualMenuPopulateEvent evt)

Called to build the contextual menu.

Parameters:

evt

The build event.

void AddElementToToolbar(VisualElement element)

Adds a visual element to the toolbar.

Parameters:

element

The element to add.

IActionImplementor AddAction< T >(out T data, Vector2? position = null)

Adds an action.

Parameters:

T

The action type.

data

The action data instance.

position

The position of the action.

Returns:

The editor representation of the action.

IActionImplementor AddAction(
    System.Type actionType,
    Vector2 position,
    out object data
)

Adds an action.

Parameters:

actionType

The action type.

position

The position of the action.

data

The action data instance.

Returns:

The editor representation of the action.

VisualElement OpenPanel(
    string title,
    System.Action onClosed,
    System.Func canClose
)

Opens a popup panel.

Parameters:

title

The title.

onClosed

Called when panel is closed.

canClose

Called to determine _if_ the panel can be closed.

Returns:

Content container of the panel.