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

270
Vistas
Unity C# What does the funtion Application.CanStreamedLevelBeLoaded(String string) do?

in the ARFoundation Unity samples I found the following code snippet:

public void BackButtonPressed()
        {
            if (Application.CanStreamedLevelBeLoaded("Menu"))
            {
                SceneManager.LoadScene("Menu", LoadSceneMode.Single);
                LoaderUtility.Deinitialize();
            }
        }

Can somebody please explain to me when and why to use Application.CanStreamedLevelBeLoaded(String string)? In the Unity docs I found this as explanation: Can the streamed level be loaded?

But that tells me nothing.

And when and why should one also use LoadSceneMode.Single and LoaderUtility.Deinitialize()? I found this for LoaderUtility.Deinitialize(): Deinitializes the currently active XR Loader, if one exists. This destroys all subsystems.

I appreciate any help. Thanks!

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Application.CanStreamedLevelBeLoaded does exactly what you think it should do when reading the function name, it checks if the streamed level can be loaded. Use it BEFORE attempting to actually load a streamed level. Streamed in this case means downloading the level for the WebGL client. The progress of the stream means how far the download of your level has progressed.

Use this function to check the download state, just like you see in the doc example, to prevent an exception when trying to load an unfinished level.

Behind the scenes it uses a float called downloadProgress of the UnityWebRequest to determine if the file is downloaded.

https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest-downloadProgress.html

Deeper down you will most probably find a FileStream, hence the name of the function.

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