Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

SetEnable(Entity) On EntityCommandBuffer?

Discussion in 'Entity Component System' started by Lieene-Guo, Sep 22, 2020.

  1. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
  2. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    884
  3. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    You can add/remove the Disabled tag already with the ECB, you just need to check if it has a LinkedEntityGroup and, if so, also add/remove the Disabled tag for the entire group.
     
  4. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    That way I said, "So we dont have to go through LinkedEntityGroup, witch is Optional..."
     
  5. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    I believe that such API for ECB would still require a ComponentTypeHandle<LinkedEntityGroup> anyways, as to do that in parallel safely the LinkedEntityGroup would need to be at least be marked as readonly before schedule.

    Due that, I think you are better off creating an extension method instead, but following this thread just in case Unity team has another answer.
     
  6. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    I fact ECB just needs an int TypeIndex. If you go deep in Entity source.
     
    brunocoimbra likes this.