Search Unity

Question How to reset a world with subscenes

Discussion in 'Entity Component System' started by Studiomaurer, Jul 16, 2021.

  1. Studiomaurer

    Studiomaurer

    Joined:
    Sep 5, 2012
    Posts:
    56
    I'm developing a city builder game using a procedurally generated city (about 2 mio Objects) and a couple of hundred handplaced objects stored in subscenes.

    I need to reset the city to let the player start over. When I copy all entities to a backup world and copy them back later for the reset (entityManager.CopyAndReplaceEntitiesFrom), the entities from the subscenes are missing. Also when I try to reload the subscenes, they are empty. How do I handle subscenes for this scenario? The contents will be modified ore even deleted during the game, I need to reset them to the start state...

    Any hint is appreciated...