Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

IJobProcessComponentData for IBufferElementData

Discussion in 'Entity Component System and C# Job system' started by PublicEnumE, Feb 10, 2019.

  1. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    15
    Are there are plans to introduce new "IJobProcess" job types that can support IBufferElementData as generic arguments? Right now I'm using Chunk Iteration.

    Thanks!
     
    Antypodish likes this.
  2. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    457
    You can also use BufferFromEntity<> inside the IJobProcessComponentDataWithEntity
     
    Antypodish likes this.
  3. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    15
    Looking at the source code, it seems like it might be possible to create your own job interfaces, which would auto-populate an "Execute" method however you might like.

    It would be involved, but maybe not impossible. I don't see too much internal stuff being called from IJobProcessComponentData.cs or IJobProcessComponentData.generated.cs.
     
  4. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    15
    Thanks for the suggestion. In this case I'd like to only work on Entities which have a DynamicBuffer of a certain type. I'd like the System's execution to be conditional on those buffers being present, like you can do with a ComponentGroup (or like an IJobProcessComponentData does this).
     
    Last edited: Feb 11, 2019
  5. jooleanlogic

    jooleanlogic

    Joined:
    Mar 1, 2018
    Posts:
    164
    You can add
    [RequireComponentTag(typeof(YourIBufferElementDataType))]
    above the job struct which will then form part of the archetype.
     
    PublicEnumE likes this.
  6. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    15
    Aha. Turns out I didn't know about
    RequireComponentTagAttribute
    . :) Looks like this should do the trick in the meantime.

    Although if anyone has info about plans to add new IJobProcess interfaces with native support for buffers, please drop some knowledge on us. :)