Search Unity

Disable/Enable systems

Discussion in 'Entity Component System' started by Tzelon, Apr 1, 2018.

  1. Tzelon

    Tzelon

    Joined:
    Aug 24, 2013
    Posts:
    18
  2. Tudor_n

    Tudor_n

    Joined:
    Dec 10, 2009
    Posts:
    359
    You can have a look at the default world related scripts in your package cache. Currently, the default world initializer just reflects everything that derives from ComponentSystemBase and creates a manager for the type unless it specifies a DisableAutoCreationAttribute.

    I guess you could just create your own World ( it adds itself to a static list of worlds when its constructed ) and register components to that one, manually or otherwise.

    There's some non obvious boilerplate bits ( like registering the world to ScriptBehaviourUpdateOrder ), but the code in DefaultWorldInitialization.cs should be enough to get you started.
     
    Tzelon likes this.
  3. SubPixelPerfect

    SubPixelPerfect

    Joined:
    Oct 14, 2015
    Posts:
    224
    here are steps to initialize world manually
    and a bit more about worlds is here
     
    Tony_Max and Tzelon like this.
  4. Tzelon

    Tzelon

    Joined:
    Aug 24, 2013
    Posts:
    18
    Thank you all.