Search Unity

ENABLE_AR compiler define persisting in other platforms

Discussion in 'AR' started by nickfourtimes, Jan 11, 2018.

  1. nickfourtimes

    nickfourtimes

    Joined:
    Oct 13, 2010
    Posts:
    219
    So in building our game on iOS with ARKit support, we have the ENABLE_AR symbol defined in Player Settings -> Other Settings -> Scripting Define Symbols. Specifically, we have the following defined:
    Code (CSharp):
    1. CROSS_PLATFORM_INPUT;MOBILE_INPUT;ENABLE_AR
    For our standalone build, we have fewer symbols:
    Code (CSharp):
    1. CROSS_PLATFORM_INPUT
    However, when I try to build for PC, the following code is still being executed:
    Code (CSharp):
    1. #if ENABLE_AR
    2. print("This should not print in Standalone builds.");
    3. #endif
    Is there something in the ARKit plugin that is defining ENABLE_AR before every build, regardless of platform? Is it affecting a list of globally-defined scripting symbols? Why does this code execute on a PC build?