Search Unity

Load all scenes in picking event screen, then only activate the one chosen and discard the others.

Discussion in 'Prefabs' started by zhaozony, Sep 27, 2022.

  1. zhaozony

    zhaozony

    Joined:
    Jan 7, 2020
    Posts:
    29
    The need is simple: in a event picking splash screen, there are some choices for players. They will finally pick one of them. To make it smooth, I want to preload all of them and only activate one.
    However, this is not simple to achieve(maybe impossible) as it sounds like. I have read almost all posts on google about this. Basicly when two scenes are async loaded at the same time:
    `pesudo code
    load1=SceneManager.loadasync('event1',singlemode)
    load2=SceneManager.loadasync('event2',singlemode)
    load1.allowActivate=load2.allowActivate=false
    `
    load1 would stuck at 89.999%, and load2 would stuck at 0.
    So you can only actiavate load1, I didnt find a way to make load2 activate instead.
    There are some field or methods that look like working for this, like LoadOperation.priority, or SceneManager.SetActiveSence. But this are not really what they are for.
    Anyone have this experience?