Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

330
Views
Unity load scene in editor playmode synchronously

Main Question

I'm trying to load a scene in the editor while in playmode and get the exact behaviour of:

SceneManager.LoadScene(ScenePath, LoadSceneMode.Single);

Except without requiring the scene to be in the build settings.

I would have expected this to work:

EditorSceneManager.LoadSceneInPlayMode(ScenePath, new UnityEngine.SceneManagement.LoadSceneParameters(LoadSceneMode.Single));

However the scene appears to load asynchronously, which I don't want for my particular use case.

Is there a way to acomplish what I'm looking for here?

Additional details (my use case and "why" I want this)

What I'm doing is creating a loader for scene sets that will additively load a bunch of scenes with different constraints on their loading behaviour (such as: load async, always reload when transitioning same->same, and other features). I have this working fine in the editor while I'm not in play mode, I have it working fine in a built player, but the last case is getting this to work while in the editor and in play mode.

The reason I need "single" loading at all is when you transition from one scene set to another and they share no common scenes. Since I can't unload every scene, I'm just skipping the unload step all together and having the first synchronously loading scene load with LoadSceneMode.Single to cause everything else to unload.

On the off chance it's relevant (I really hope not) I'm trying to do this from inside a custom editor's OnInspectorGUI call. I'm triggering it from a button press in there.

Options I'm aware of:

  • EditorSceneManager.OpenScene with OpenSceneMode.Single
    • problem: Does not work in play mode
  • EditorSceneManager.LoadSceneInPlayMode with LoadSceneParameters(LoadSceneMode.Single)
    • problem: Scene is not loaded synchronously
  • SceneManager.LoadScene with LoadSceneMode.Single
    • problem: Scene is required to be in the build settings
  • EditorSceneManager.LoadScene with LoadSceneMode.Single
    • problem: Scene is required to be in the build settings
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Turns out I had a misunderstanding of what SceneManager.LoadScene(ScenePath, LoadSceneMode.Single); would even do.

A friend had pointed out the docs clearly state the load will happen within 1 frame, not actually at the call-site.

If you're facing a similar issue there are a few options. You could load async and subscribe to that callback to perform activation them. Another option is to subscribe to SceneManager.sceneLoaded and perform activation there.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!