Search Unity

[DisableAutoCreation] throws warning on abstract and generic systems

Discussion in 'Data Oriented Technology Stack' started by MartijnGG, Jun 13, 2019.

  1. MartijnGG

    MartijnGG

    Joined:
    May 3, 2018
    Posts:
    54
    When I have an abstract or Generic ComponentSystem defined in my code which is tagged with [
    DisableAutoCreation], I get the following error when I start my game.


    Invalid [DisableAutoCreation] on Test.TestSystemBase (only concrete types can be instantiated)


    This seem to be caused by the default ECS World filtering the systems to add to it automatically during startup.

    However shouldn't this error check be the opposite? I've explicitly tagged it NOT to be automatically created, because it is an abstract generic system.
     
  2. LastResortMatthew

    LastResortMatthew

    Joined:
    Apr 10, 2019
    Posts:
    36
    It's telling you that it literally can't instantiate an abstract system, so putting [DisableAutoCreation] on it won't do anything. I suspect it's to prevent people thinking that classes inherited from the abstract system will also inherit the attribute (they won't).
     
  3. MartijnGG

    MartijnGG

    Joined:
    May 3, 2018
    Posts:
    54
    But the attribute is inheritable. If they wanted this to not be the case, it should be turned off.
     
  4. starikcetin

    starikcetin

    Joined:
    Dec 7, 2017
    Posts:
    225