Search Unity

Loading subscenes into specific worlds?

Discussion in 'Entity Component System' started by fholm, Dec 5, 2019.

  1. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Is there any way currently to load subscenes into a specific world? I couldn't find anything for this in the API by browings around. Say I have multiple active worlds and want to load different subscenes into each one of them?
     
  2. Zec_

    Zec_

    Joined:
    Feb 9, 2017
    Posts:
    148
    I'll assume you're working with Entities 0.2+ (they've changed the APIs a bit). The API for loading SubScenes is the LoadSceneAsync function in the SceneSystem. SceneSystem works just like any system and exists per world (assuming you haven't removed the scene systems or excluded them during world creation). The SubScenes will get loaded into the world that belongs to the SceneSystem you're using.
     
    Last edited: Dec 6, 2019