How to load multiple scenes with PUN 2

Hi there,

Since I can't find anything about this on forum or Google, this is probably a noob question. But I can't figure out how to load multiple scenes with PUN 2 enable.

So actually the equivalent of:

SceneManager.LoadSceneAsync(levelToLoad, LoadSceneMode.Single);
SceneManager.LoadSceneAsync(baseLevel, LoadSceneMode.Additive);

Anyone who can point me in the right direction?

Thanks!!

Comments

  • Hi, and where is problem?
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Bender,

    Thank you for choosing Photon!

    In PUN2, PhotonNetwork.LoadLevel is async by default but it uses the default mode LoadSceneMode.Single.

    I did not test manual (load and sync level between all clients) additive scene loading myself and the rest of the team is on vacation.
    There could be issues with PhotonView already in the scene maybe?

    If I have time to test this I will report back here.
  • Hi @JohnTube

    Thanks for being available at christmas time ;-)

    When I load the scenes separately, they both load well. But loading them at the same time like this:

    PhotonNetwork.LoadLevel("Scene1");
    PhotonNetwork.LoadLevel("Scene2");

    I will get this message:

    PUN cancels an ongoing async level load, as another scene should be loaded. Next scene to load:
  • Or you can:
    SceneManager.LoadScene(scene, LoadSceneMode.Single)
    SceneManager.LoadSceneAsync(loaded, LoadSceneMode.Additive);
    SceneManager.SetActiveScene(SceneManager.GetSceneByName(loaded));
  • @OneManArmy I don't think that's working with PUN since levels must be loaded via PUN.
  • "levels must be loaded via PUN"
    No, you are wrong.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Bender,

    Additive scene loading synchronization needs to be done manually in PUN.
    There is no built-in or generic solution for it.