Search Unity

define for publish build only?

Discussion in 'Windows' started by Jonny-Roy, Oct 1, 2013.

  1. Jonny-Roy

    Jonny-Roy

    Joined:
    May 29, 2013
    Posts:
    666
    Hi,

    I have a class that is cross platform and builds to iOS, Andriod and Windows Store, for windows store I just use: NETFX_CORE define for the code that is Windows Store specific, this mean unity will ignore it and pass it to visual studio to build and works great.

    I'm not sure how to achieve the same for windows phone, should we use SILVERLIGHT ? as I notice this is one of the defines passed to VS in the final project?

    Thanks,

    Jon
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,920
    Hi,

    as far as I know, Windows Phone doesn't have this. So basically to explain a bit more in-depth:
    For Windows Store Apps:
    * UNITY_METRO is defined for every script, doesn't matter in which language it's written (JS, Boo, C#)
    * NETFX_CORE is defined during build time only for C# scripts which aren't located in Assets\Plugins, Assets\Standard Assets, Assets\Pro Standard Assets, and only if in Player Settings, you select Compilation Overrides - Compile against .NET Core

    For Windows Phone 8:
    * UNITY_WP8 is defined for every script, doesn't matter in which language it's written (JS, Boo, C#)
     
  3. Jonny-Roy

    Jonny-Roy

    Joined:
    May 29, 2013
    Posts:
    666
    Hi Thomas,

    Hmmm, shame, it's a really useful feature having a build time only switch...but I'm realising the best way to work around is to use a fake plugin for unity and an empty one for build does that sound like the best work around to you?

    Thanks,

    Jon