OpenSceneToolbarDropdown

EditorToolbarDropdown button that displays the Paragon Unity icon and toggles the OpenSceneToolbarPopup when clicked. Automatically disables itself during play mode and re-enables on return to edit mode.

Definition

Namespace: Paragon.Editor.OpenSceneToolbar Assembly: Paragon.Editor.dll

[EditorToolbarElement(ID, typeof(SceneView))]
public class OpenSceneToolbarDropdown : EditorToolbarDropdown

Inheritance: EditorToolbarDropdown → OpenSceneToolbarDropdown

Remarks

The dropdown registers for AttachToPanelEvent and DetachFromPanelEvent to manage its EditorApplication.playModeStateChanged subscription. When play mode is entered, the button is disabled (SetEnabled(false)) to prevent scene changes during play. It re-enables when returning to edit mode.

The icon is set to DrawGUI.Icon.Paragon.Unity — the Paragon framework's Unity icon from the icon cache system.

Methods

OnAttachToPanel

Virtual callback when the dropdown attaches to a panel. Subscribes to EditorApplication.playModeStateChanged.

protected virtual void OnAttachToPanel(AttachToPanelEvent attachToPanelEvent)

OnDetachFromPanel

Virtual callback when the dropdown detaches from a panel. Unsubscribes from EditorApplication.playModeStateChanged.

Extension Points

Optional Overrides

Method
Purpose

OnAttachToPanel(AttachToPanelEvent)

Add custom setup when the element attaches to a panel

OnDetachFromPanel(DetachFromPanelEvent)

Add custom cleanup when the element detaches

circle-info

When overriding OnAttachToPanel or OnDetachFromPanel, call base to preserve the play mode state change subscription.

Constants

Constant
Value
Description

ID

"open-scene-overlay/dropdown"

Element identifier (derived from overlay ID)

NAME

"Open Scene"

Display name and tooltip

See Also

Last updated