Skip to content

manage_build blocks on unsaved scene save dialog #1341

Description

@TeapoyY

Problem

When manage_build triggers a player build while the open scene has unsaved changes, Unity shows a modal Save modified scenes? dialog. Because MCP runs headlessly/automated, the build hangs until a user dismisses the dialog manually.

Expected behavior

manage_build should save assets and open scenes automatically before calling BuildPipeline.BuildPlayer, so automated builds are not blocked by save prompts.

Steps to reproduce

  1. Open a scene in the Unity Editor and make a change without saving.
  2. Call manage_build with action=build.
  3. Observe Unity prompts to save modified scenes and the build does not proceed until the dialog is handled.

Proposed fix

Call AssetDatabase.SaveAssets() and EditorSceneManager.SaveOpenScenes() in BuildRunner immediately before BuildPipeline.BuildPlayer runs (same pattern already used by TestRunnerService for test runs).

Environment

  • Unity MCP manage_build tool
  • Any Unity version where BuildPipeline.BuildPlayer prompts for unsaved scenes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions