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

How to make a custom build for Steam?

Discussion in 'Editor & General Support' started by RakNet, Nov 24, 2020.

  1. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    When making my build for Steam I want code such as "SteamAPI.RestartAppIfNecessary(GetAppID())" which will restart the game if the user is not using Steam.

    Otherwise, I don't want that code. The only thing is changes is the EXE.

    Short of having to make the build twice, and manually comment out that line of code between the two builds, is there a better approach?

    I'm surprised the answer to this isn't in an easily findable FAQ somewhere. You'd think as many people who have made games for Steam using Unity would have had the same question.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Are you adding/removing the Steam SDK stuff as needed as well? Or are you just planning to leave it in?
     
  3. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    Don't care if it's in the project, I just need to change a function call so it doesn't run.
     
  4. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    313
    All I can find is here: https://docs.unity3d.com/Manual/PlatformDependentCompilation.html you have "Platform custom #defines" which is fine if I want to manually set and unset it every build, and also spend an hour twice making two builds. However, it's unreasonable and also guaranteed sooner or later I will make a mistake.

    Does Unity not have any kind of support for build systems or automated build steps?
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350