OpenSceneToolbarPopup
EditorWindow that displays as a dropdown popup with two ListView panels — bookmarked scenes and all other scenes. Supports bookmark management (add/remove), edit mode toggling, left-click to open a scene, and right-click context menu for opening with dependencies or additively. Bookmarks are persisted via EditorPrefs.
Definition
Namespace: Paragon.Editor.OpenSceneToolbar Assembly: Paragon.Editor.dll
public class OpenSceneToolbarPopup : EditorWindowInheritance: EditorWindow → OpenSceneToolbarPopup
Remarks
The popup is shown via ShowAsDropDown() positioned relative to the toolbar button. It dynamically resizes based on the number of visible items, capped at max_list_size (5) items per list. The window uses two UXML template assets: one for the main layout and one for individual scene list items.
Scene Loading
Scenes are loaded from AssetDatabase on each popup open. The Paragon.Core.SceneManagement.Scene wrapper provides Name, GUID, and Path properties. Opening a scene prompts to save modified scenes first via EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo().
Input Handling
Left-click scene
Opens scene in single mode (replaces current)
Right-click scene
Shows context menu: Open with Dependencies, Open Additive, Open Additive with Dependencies
Click "+" button
Adds scene to bookmarks (edit mode, scene list)
Click "-" button
Removes scene from bookmarks (edit mode, bookmark list)
Click gear icon
Toggles edit mode on/off
Fields
visualTreeAsset
VisualTreeAsset
private
Main popup UXML template
sceneListItemTreeAsset
VisualTreeAsset
private
Per-item UXML template for scene entries
bookmarkedScenes
List<Scene>
private
Currently bookmarked scenes
otherScenes
List<Scene>
private
All non-bookmarked scenes (sorted by name)
isEditModeActive
bool
private
Whether edit mode is active (shows +/- buttons and scene list)
Constants
width
135
Fixed popup width in pixels
item_height
18
Height of each scene list item in pixels
max_list_size
5
Maximum visible items per list
Static Methods
ToggleDropdown
Creates and shows the popup as a dropdown below the specified button rect.
buttonRect
Rect
The toolbar button's world-space bounds (used for positioning)
Persistence
"OpenSceneToolbarBookmarks"
EditorPrefs
Comma-separated scene GUIDs
Bookmarks are loaded on each popup open (LoadPrefs) and saved when the popup closes (OnDestroy → SavePrefs). The ResetPrefs method clears all bookmarks.
Common Pitfalls
Edit mode auto-activates when bookmarks are empty. If all bookmarks are removed, isEditModeActive is forced to true so the user can add new bookmarks. It cannot be deactivated until at least one bookmark exists.
Scenes are loaded fresh each time. LoadPrefs() queries AssetDatabase.FindAssets("t:Scene") on every popup open. Deleted scenes are gracefully filtered out — their GUIDs won't match any loaded asset.
See Also
OpenSceneToolbarDropdown — the toolbar button that toggles this popup
OpenSceneToolbarOverlay — the SceneView overlay host
OpenSceneToolbar — system overview
Last updated