Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Excluding Systems from Default World

Discussion in 'Entity Component System' started by PublicEnumE, Aug 8, 2019.

  1. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    729
    I’d like to use Unity’s default world, but I’d like to exclude a few systems from Unity’s creation of that world, which I will call manually.

    Is there an attribute, or any other way to designate that Unity should not try to add an individual system type to it’s default world?
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,753
    [DisableAutoCreation]

    Alternatively you can implement ICustomBootstrap and remove the system from the list (which means you can do it dynamically depending on certain conditions)
     
  3. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    729
    Thank you. If I use [DisableAutoCreation], will I still be able to manually call Update() on the system later (from another system)?
     
  4. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,683
    Yes