Search Unity

Should I create separate projects for each platform I publish to?

Discussion in 'General Discussion' started by Johnscaban, Sep 16, 2021.

  1. Johnscaban

    Johnscaban

    Joined:
    May 9, 2020
    Posts:
    23
    I'm creating a multiplayer game. I would like to publish it to multiple platforms. Should I create separate projects? I'm using the new input system.
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
    I believe that the whole point of unity was using a single codebase for multiple platform and being able to switch build target with a button press.

    You may have separate folders for different platforms (just so you won't waste time reimporting upon switch), but in my opinion, they all should be pointing at the same master repository with code and they all should use the same codebase.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    This sounds like a nightmare IMO.
     
  4. Johnscaban

    Johnscaban

    Joined:
    May 9, 2020
    Posts:
    23
    Ok, just wanted opinions thanks.
     
    NotaNaN likes this.
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,203
    This is precisely what I do with large projects. Switching platforms is not that lengthy of a process for me but I like having multiple projects open working on one while performing a lengthy process on the others.
     
    NotaNaN likes this.
  6. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Hell no!

    That's what preprocessor directives in Unity are for...

    Code (CSharp):
    1. #if UNITY_WEBGL
    2. // Do something specific for WebGL
    3. #elif UNITY_STANDALONE
    4. // Do something specific for PC standalone build
    5. #elif UNITY_EDITOR
    6. // Do something only while in the editor
    7.  
    If you had separate projects each time you edited something in a scene you'd need to merge or do those same changes in the other projects.

    Unless you want to have a project running HDRP on one platform, and built-in renderer on others, I'd highly recommend sticking to one project.