Search Unity

JobSystem: I don´t have JobHandles

Discussion in 'Entity Component System' started by der_Durchgepeitschte, Apr 4, 2019.

  1. der_Durchgepeitschte

    der_Durchgepeitschte

    Joined:
    Mar 28, 2019
    Posts:
    5
    Hello fellow Uniteers,
    new day, new problem:
    I want to implement a JobSystem but i define a JobHandle. using UnityEngine.Jobs; is implemented and other stuff is known as well like TransformAccess etc. but not JobHandle.
    Is it deprecated and not documented, or have i just ran into a bug?

    Hope someone can help me. Thanks in advance and best regards.
     
  2. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    What are you inheriting from (which class), and what's the return value of your OnUpdate?
     
  3. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    if you don't use ecs:
    just create a default JobHandle by the keyword "default" or "new JobHandle()"

    If you are using ecs:
    use JobComponentSystem and override OnUpdate
    it provides you the handle
     
  4. der_Durchgepeitschte

    der_Durchgepeitschte

    Joined:
    Mar 28, 2019
    Posts:
    5
    Oh god, i solved it myself. It couldn´t find the type/name space, but that was because i used UnityEngine.Jobs;
    Now i imported Unity.Jobs; and now it works. Maybe they moved it or something else because all the tutorials use UnityEngine.Jobs...
    But thanks nonetheless.
     
  5. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    Hint for future reference:
    All new packages are set under Unity. (instead of UnityEngine)
    That includes Jobs, Entities, Transforms, etc ;)
     
    der_Durchgepeitschte likes this.