Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Targeting IPhone and Android with C#

Discussion in 'Scripting' started by TerryMcP63, Jun 1, 2012.

  1. TerryMcP63


    Jun 1, 2012
    Hello everyone,

    I'm just getting started - thinking about developing a simple Avatar using C#. I'm wondering about the following and would appreciate pointers to existing material which may answer my questions. If anyone would care to offer direct feedback, I'd be grateful.

    When developing a C# code base for a simple Avatar project that targets both Android and iPhone, will I encounter the need to develop platform specific code?

    Let's assume that I won't go out of my way to target platform specific features and would endeavor to reduce any platform specific coding. Given these rather vague constraints, what percentage of platform specific code can I expect?

    Should I plan on targeting, say, Android now and "port" to iPhone later - or would it be significantly simpler to target both platforms up front?

    Many thanks in advance for any guidance that may be offered.

  2. bigmisterb


    Nov 6, 2010
    The documentation is probably going to answer most of your questions. I think Android and IPhone share alot of the same features. Both have some specific but it's not that bad.

    some 99% of your code will not be platform specific, and you can add things in that will simple get the data you need from either and put it where you need it to be. I have done Android/pc games which are far different. But once you get the feel down, you are good.
  3. _Petroz


    May 13, 2010
    Unity does cross platform development very well. I don't have any platform specific code differences between iOS and Android.

    That is what I did, mainly because I didn't own a mac when I started. Most of the effort of 'porting' was setting up the dev environment on my mac when I did get one. Once I had everything installed, I opened my project and Unity spent a while (maybe10 minutes) reimporting the assets and it worked right away.

    If you make a plugin which links to java/native code then that will require platform specific code. Other than that it all pretty much 'just works'.