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 Force all jobs that require LocalToWorld to complete

Discussion in 'Entity Component System' started by 8bitgoose, Jan 2, 2023.

  1. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    449
    Hi,

    I need to do a hacky callback method in order to make sure my VR rig works properly in ECS. I need to call some code just before the render. However I have a race condition and I need to ensure that all the jobs that are using TransformAspect are completed before I fire this.

    I am currently using
    EntityManager.CompleteAllTrackedJobs();
    to finish all jobs but I would prefer something that doesn't end every job in case I want to have multi frame jobs in the future.

    Just looking to do a query on TransformAspect and make sure all those jobs that use that are done. Will save me a lot of time making sure that I don't have to manually set up dependancies for this one system.
     
  2. joepl

    joepl

    Unity Technologies

    Joined:
    Jul 6, 2017
    Posts:
    85
    apkdev likes this.
  3. 8bitgoose

    8bitgoose

    Joined:
    Dec 28, 2014
    Posts:
    449
    apkdev likes this.