Search Unity

Passing lambdas to jobs

Discussion in 'Entity Component System' started by Blargenflargle, Jul 6, 2020.

  1. Blargenflargle

    Blargenflargle

    Joined:
    Feb 24, 2019
    Posts:
    92
    Is there any way to pass a lambda (or anything lambda-like) into jobs? I'm trying to design around not having lambdas but any solution I can think of to accomplish what I want to do causes my code base to balloon.

    If I just can't use lambdas right now, is there any hope for me on the horizon? Are lambdas (or something lambda-like) for jobs planned? Thank you.
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
  3. Blargenflargle

    Blargenflargle

    Joined:
    Feb 24, 2019
    Posts:
    92
    While that may be a good place for me to start it's certainly a lot less convenient than lambdas. I'm also not sure it's gonna work for what I need. For example, can I make a nativearray of functionpointers?
     
  4. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    Yes; that's fine.
     
  5. Blargenflargle

    Blargenflargle

    Joined:
    Feb 24, 2019
    Posts:
    92
    Awesome thank you