Search Unity

Question How to schedule Job dependent on EntityCommandBuffer?

Discussion in 'Entity Component System' started by Zylkowski_a, Jul 3, 2020.

  1. Zylkowski_a

    Zylkowski_a

    Joined:
    Jul 27, 2019
    Posts:
    157
    I am creating some entities using commandbuffer and after that I would like to schedule a job which works on those entities' data. How can I make job dependent on EntityCommandBuffer playback?
     
  2. Abbrew

    Abbrew

    Joined:
    Jan 1, 2018
    Posts:
    417
    Have the system that schedules the job be tagged with [UpdateAfter(typeof(MyEntityCommandBufferSystem))]. Now once the ECBS has played back the system will execute and begin scheduling jobs
     
  3. Zylkowski_a

    Zylkowski_a

    Joined:
    Jul 27, 2019
    Posts:
    157
    ECBS is in system group and after that system group the system with said job runs. When I run job with Run it works fine but with Schedule it doesn't
     
  4. Zylkowski_a

    Zylkowski_a

    Joined:
    Jul 27, 2019
    Posts:
    157
    never mind I just didn't call Complete