Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

334
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda