Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How ECS will handle multiple write groups to the same component?

Discussion in 'Entity Component System' started by poon2, Aug 10, 2023.

  1. poon2

    poon2

    Joined:
    Oct 30, 2022
    Posts:
    10
    Let's say there is a component A which is an output component.
    Then we have component B and C:
    Code (CSharp):
    1. [WriteGroup(typeof(A))] public struct B : IComponentData {}
    2. [WriteGroup(typeof(A))] public struct C : IComponentData {}
    And BSystem is querying A and B, and CSystem is querying A and C.

    If an entity has A, B and C, how is this going to work out? Do both of BSystem and CSystem can access the entity? Or should there be another system that queries A, B and C for the query to return the entity?
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,975
    Neither will find the entity.

    This.