Search Unity

!! Unity 4.7.1 Platform Dependent Compilation Broken !!

Discussion in 'Editor & General Support' started by MrEsquire, Mar 7, 2016.

  1. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I downloaded the latest version of Unity 4.7.1 to upgrade a old game that has been developed with the Unity 4.6 series. I switched project to Android but when I check my scripts:

    Code (CSharp):
    1. #if UNITY_ANDROID
    2.     public const string GemsPack = "com.xxx.xxxx";
    3. #endif
    4.  
    The public const string GemsPack = "com.xxx.xxxx"; part of code is greyed out, not sure why this is, when I remove the #if UNITY_ANDROID all seems be working ok.

    Not sure what I has gone wrong, did fresh install and made sure all other Unity versions where removed from PC.
     
    Last edited: Mar 8, 2016
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    BUMP, need confirmation if anyone else has issue or isolated to myself!
     
  3. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    I've seen similar stuff going on in Unity 5 (the code's greyed out inside the #ifdef/#endif tags) but in most of those cases, I find it's porbably a syntax highlighting oversight, i.e. it actually compiles fine.

    On that note though... is it actually breaking the final game? If not, then it's just a visual error, and will work fine. :)
     
    MrEsquire likes this.
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    I am pretty sure it's working properly for us. Otherwise it wouldn't compile.

    Visual Studio/Monodevelop messing up and forgetting what platform it's supposed to use happens from time to time though and it's not specific to 4.7.1.

    The important question is: Does your code compile correctly?
     
    MrEsquire likes this.
  5. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I just tried on a Windows Machine and the issue is gone, it seems its related to MacOSX and Mono.
    I had many versions of Unity on Mac machine and not sure if its conflict between 4.6x and 5.3x, but should not be the case. Something strange is going on for sure. And yes I renamed folders in Mac so not installing ontop of each other.