Search Unity

How to structure projects for cross-platform development

Discussion in 'General Discussion' started by PantonVentura, Jul 30, 2019.

  1. PantonVentura

    PantonVentura

    Joined:
    Apr 26, 2018
    Posts:
    42
    I am very new to Unity and like that your game can be built for a variety of platforms.

    But I'm unsure how to structure my projects or the folders within them to optimise reuse and minimise duplication.

    Obviously iOS and Android have different APIs for device access etc. and I may wish to do platform specific things on Windows vs Linux vs MacOS.

    Is there are recommended strategy for this? I even like to have my Unity layout different for mobile vs desktop games for example.
     
  2. PantonVentura

    PantonVentura

    Joined:
    Apr 26, 2018
    Posts:
    42
    Anyone? I would have thought this would be a fairly standard dilemma for Unity devs?
     
  3. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    For me there wasn't really a different folder structures between them especially for mobile ports. They mostly share the same scripts even. The only time they are in a seperate files/folders are for platform specific 3rd party plugins.

    Between pc/consoles and mobiles though, I'll probably branch it into another project.
     
  4. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    While it's nice that Unity has the capability of deploying to multiple platforms, and the work of porting from one platform to another is minimal compared to rebuilding the game from scratch for each platform, as a solo developer, I decided to focus my efforts on a single platform. Windows. It turns out the time that I spent trying to consider new UI layouts for console and/or mobile felt kind of wasted when I don't even have a f*cking game yet. So, if you are a solo developer, I'd recommend just focusing on one platform until you have a finished game. Yes, you should be mindful how the user experience will be between platforms, but I think it's a lot more important to have a finished game first.

    If you do decide to try out launching on multiple platforms, I'd try to get a basic build out of your game on all target platforms as early as you can. And, while you develop your game, and include more systems and possibly Unity assets (say, NGUI for UI for example), occasionally deploy your game to those target platforms to make sure they work as you would expect them. As you can imagine, the more features you add to your game, the more testing you have to do on all those platforms. To me, it sounds like a waste of my time, but that's me. Good luck!