Search Unity

ECS questions GameObject entity component settings, Things which we can call in OnUpdate and ...

Discussion in 'Entity Component System' started by Ashkan_gc, Feb 13, 2019.

  1. Ashkan_gc

    Ashkan_gc

    Joined:
    Aug 12, 2009
    Posts:
    1,124
    First of all is there any limit on what we can call in OnUpdate of JobComponentSystem ? I mean practical/technical ones not theoratical ones.

    2- what are the systems shown in GameObjectEntityComponent? Are those only for visualization purposes or they actually affect which systems run/...

    3- When barrier commands run? is it automatic or we should call something? by automatic I mean does the system detect where in the loop it can run or we should call something

    4- does worlds get destroyed when we change Unity scenes or we should call APIs for that to happen

    Thanks for any kind person who responds to this, I'm at a point that I know what I need to do theoratically but practically I don't know always when to call and what API. I hope a more stable version with a more complete reference emerges soon cause this is very exciting stuff.
     
  2. NoDumbQuestion

    NoDumbQuestion

    Joined:
    Nov 10, 2017
    Posts:
    186
    1. - OnUpdate inside JobComponentSystem is run on mainthread. You use this mainthread to pass huge struct data (native type) to other thread through "Jobs" so it can read from that data and process it.
    - the limit is that you can only pass Native<blittable struct> or Readonly pointer type (you can pass reference of class instance - not recommended) to Jobs

    2. Those are ComponentGroup inside system that have access Read/Write to your entity. The more you add component, the more system you have there

    3. You have to update barrier manually. At the system you want it to run. (The system that have [UpdateBefore/After])
    upload_2019-2-14_13-59-36.png

    4. Entity World is not same as Unity Scene. So no.
     
  3. Ashkan_gc

    Ashkan_gc

    Joined:
    Aug 12, 2009
    Posts:
    1,124
    Thanks for the response, on 1, I meant what unity API am I allowed to call in general and I knew the purpose of it but I guess I'm free to call whatever I want as it seems.
    Others were up to the point, thanks