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

Conditionally Dynamic Device Specific Build Process

Discussion in 'iOS and tvOS' started by danielsonchris, Apr 29, 2011.

  1. danielsonchris

    danielsonchris

    Joined:
    Feb 12, 2011
    Posts:
    43
    On my second cup of coffee here and hope I make sense with my questions here.

    After watching the fantastic Smuggle Truck design/build discussions here:
    http://learnunity3d.com/2011/04/smuggle-truck-2d-techniques-talk/
    I was perplexed by how they created the iPad/iPhone/Mac OS conditional compilation build all from a single project. Only those assets referenced for that build are baked into the final project that is then sent to XCode.

    I'm aware of the preprocessor flags (http://unity3d.com/support/documentation/Manual/Platform%20Dependent%20Compilation.html). I also understand how to use them.

    I guess the hurdle(s) I haven't figured out yet are the following.

    1. How does one condition the build between UNITY_IPHONE and UNITY_IPAD? Note: there isn't any UNITY_IPAD define that I'm aware of. Within the Unity editor it is not possible to pass in custom preprocessor defines globally. They are scoped per-script. I see the command line option of "-executeMethod …" (http://unity3d.com/support/documentation/Manual/Command%20Line%20Arguments.html) Perhaps that is the magic sauce?

    2. How did they conditionally include only unique assets to that particular build? For example, Mac OS X textures would be a higher resolution than those for the iPad and iPhone. Perhaps, this will be answered in question one.

    Anyone have any ideas or other forum links that I may have missed?
    Note, I have seen this: http://forum.unity3d.com/threads/17196-Project-wide-conditional-compilation?highlight=Conditional+Compilation
     
  2. danielsonchris

    danielsonchris

    Joined:
    Feb 12, 2011
    Posts:
    43
    Last edited: Apr 29, 2011