Search Unity

Question Creating a seperate new World and the proper way to initialize it

Discussion in 'Entity Component System' started by trazd, May 30, 2020.

  1. trazd

    trazd

    Joined:
    May 4, 2018
    Posts:
    9
    Hi, everyone,
    Basically, I'm trying to create a new World for handling some procedural generation work, but I just can't get the world set up properly.
    Would I need to have a
    ICustomBootstrap
    ? Currently what I have is something like.
    Code (CSharp):
    1. World world0 =  new World(worldName);
    2. world0.CreateSystem<blah>();
    and I run them using a mono bootstrap, the world does get created, but the system never shows up on the entity debugger, nor does it run. (I verified its OnCreate function being called, but its OnUpdate was never reached, even with [AlwaysUpdate]).
     
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,685
    Use forum search, it was discussed THOUSANDS times why it not updating, why it not appearing in Entity Debugger (don't think is rude, take is as advice, because you really safe your time just by searching on the forum, as most of the questions already answered many times) :) and read the documentation about multiple worlds handling and player loop
    https://docs.unity3d.com/Packages/com.unity.entities@0.11/manual/system_update_order.html
     
    Last edited: May 30, 2020
    MNNoxMortem likes this.
  3. trazd

    trazd

    Joined:
    May 4, 2018
    Posts:
    9
    Thanks for replying, but you are not being helpful here. A lot of posts are now outdated and some I have tried but didn't work, if you know a working solution in a post you could've just linked it. And the documentation isn't really clear on what you need to do to get the systems working.
     
  4. trazd

    trazd

    Joined:
    May 4, 2018
    Posts:
    9
    I think I know what's wrong, so if I have multiple worlds, I would need to manually include them in the playerloop using an ICustomBoostrap implementation. Otherwise only the default world will be updated.
     
    Dr_SuiuS likes this.