Skip to main content

process_pending_save_as_prefab

Function process_pending_save_as_prefab 

Source
pub fn process_pending_save_as_prefab(
    project_vfs: Option<&Arc<Mutex<ProjectVfs>>>,
    world: &GameWorld,
    editor_state: &Arc<Mutex<EditorState>>,
)
Expand description

Drains [EditorState::pending_save_as_prefab] and [EditorState::pending_save_as_prefab_at], writing the entity’s subtree as a .kprefab (Recipe-encoded).

  • The _at variant carries a pre-chosen forward-slash relative path under <project>/assets/; the dispatcher writes directly without showing a dialog. Set by drag-drop (entity → asset browser folder).
  • The plain variant opens an rfd::FileDialog. Set by the scene tree’s “Save as Prefab…” context entry.