Search Unity

Unity 2017 is not considered newer than Unity 5.3.4 in Platform dependent compilation

Discussion in 'Scripting' started by davidosullivan, Jul 13, 2017.

  1. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    387
    In the 2017 docs it still says:

    "Starting from Unity 5.3.4, you can compile code selectively based on the earliest version of Unity required to compile or execute a given portion of code. Given the same version format as above (X.Y.Z), Unity exposes one global #define in the format UNITY_X_Y_OR_NEWER, that can be used for this purpose."

    However scripts that use the definition "#if UNITY_5_3_4_OR_NEWER" don't work in Unity 2017- Unity2017 is obviously not considered 'newer'. Instead you have to modify your code (resubmit to the app store etc) to use the new '#if UNITY_2017_1_OR_NEWER' in addition.

    Is this a bug or a 'feature'?
     
    Doomby, Faikus and Zaelot like this.
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Sounds like a bug. Throw in a report.

    I can think of no reason why this might have been deliberately included.
     
  3. crushingcups

    crushingcups

    Joined:
    Oct 2, 2013
    Posts:
    1
    The docs are unclear, it actually means UNITY_5_3_OR_NEWER is the first version that will work. That's what they mean with "Starting in Unity 5.3.4".
     
  4. gaps

    gaps

    Joined:
    Jan 1, 2014
    Posts:
    15
    The docs mention X Y (5 3), yet you are trying to use X Y Z (5 3 4).
    If you try with UNITY_5_3_OR_NEWER instead of UNITY_5_3_4_OR_NEWER, does it work?
     
  5. 1017209507

    1017209507

    Joined:
    May 24, 2018
    Posts:
    1
    UNITY_5_3_OR_NEWER work fine.
     
  6. Castle24

    Castle24

    Joined:
    Feb 26, 2018
    Posts:
    3
    How to distinguish the different version between 2018.1 and 2019.1?
    I try to like this: UNITY_2019_1_1_OR_NEWER, but it's not ok.
     
  7. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    The docs says that
    UNITY_X_Y_OR_NEWER
    is supported, so that means that you want
    UNITY_2019_1_OR_NEWER