Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity 5.5 preprocessor directive determiner is broken

Discussion in 'Scripting' started by Hullabu, Dec 1, 2016.

  1. Hullabu

    Hullabu

    Joined:
    Oct 23, 2014
    Posts:
    18
    So, in latest version of Unity 5.5 scripts with these text doesn't compile while building player.
    Code (CSharp):
    1. string s = @"some multiline text
    2. #next line";
    or
    Code (CSharp):
    1. /*some multiline comment
    2. #next line*/
     
  2. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    What is the error you are seeing? Did you report the bug?
     
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    The compiler got updated in 5.5. This may well be a bug as a result of that. I would suggest a bug report. I can't imagine this exact scenario would have been caught in QC.
     
  4. Hullabu

    Hullabu

    Joined:
    Oct 23, 2014
    Posts:
    18
    Error: "error CS1024: Wrong preprocessor directive"
    So, if a new line begins with #, it will cause error, doesn't matter if it comment or string.
    And yes, I did report a bug.
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    In that case there is not much to do. For now simply avoid using a hash at the beginning of a line.