Search Unity

Platform dependent compilation for C# Jobs !?

Discussion in 'Entity Component System' started by Vagabond_, Jul 13, 2018.

  1. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi,
    is there a way to write Jobs dependent code of a scripted system for 2018.2 + in case the main targeted Unity version is 5.6.4 !

    This seems to work but will only check for both Unity versions which will currently support Job system.
    #if UNITY_2018_2 || UNITY_2018_3
    #endif

    Any better ( more generic ) way of detecting when job system is supported !?
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    #if UNITY_2018_2_OR_NEWER

    will do what you're doing but continue to work in future releases.

    You can see all this type off stuff from inside your IDE

     
    Vagabond_ likes this.
  3. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Great, thanks ! For some reason Visual Studio is not showing that for me!
    Will double check it now !

    Thanks again !