Search Unity

~ Already solved

Discussion in 'Entity Component System' started by tertle, Mar 4, 2020.

  1. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    ~edit~ did not realize a better solution was so close.

    For debugging purposes, using a constant like
    Code (CSharp):
    1. [Burst(Debug = !Const.EnableBurst)]
    on jobs is a very handy pattern to use as it easily allows you to disable groups of jobs from the burst compiler without having to go through and comment them (or disabling burst project wide which just isn't an option anymore when you get a huge project.)

    This pattern was also usable with Lambda jobs, by doing a similar
    Code (CSharp):
    1. this.Entities.WithBurst(Consts.EnableBurst)
    but has been marked as obsolete pending removal.

    A similar pattern can still be achieved with precompiler defines, but it's just much more tedious and makes code very ugly.
     
    Last edited: Mar 4, 2020
  2. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,685
    In 1.3.0-preview.4 they added possibility to debug burst code directly without disabling burst at all. It's suitable for you? (But currently only for Native Debuggers) (For debugging of course, for build defines it's still useful patterns.)
     
    Last edited: Mar 4, 2020
    mr-gmg, Lee_Hammerton and pal_trefall like this.
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Yes, it probably is
     
    sheredom likes this.