Multiple Custom builds for the same platform

Hi,

My project needs to be released for the same platform in two different ways. To be more specific, I have a Windows release for both VR and Not-VR.

  [MenuItem("File/AutoBuilder/Windows(Client)")]
  public static void PerformWinClientBuild () {
    PlayerSettings.virtualRealitySupported = false;
    EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows64);
    BuildPipeline.BuildPlayer(GetClientScenePaths(), "Builds/Client.exe", BuildTarget.StandaloneWindows64, BuildOptions.None);
  }

  [MenuItem("File/AutoBuilder/Windows(Server)")]
  public static void PerformWinServerBuild () {
    PlayerSettings.virtualRealitySupported = true;
    EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows64);
    BuildPipeline.BuildPlayer(GetServerScenePaths(), "Builds/Server.exe", BuildTarget.StandaloneWindows64, BuildOptions.None);
  }

Is there a way I can get the same results using Unity Cloud?

Thank you!

Hi, you can set it to call custom build scripts as you have above so you shoudl be able to call those exact methods.

Have a read here: Unity ID

Sorry I cant help anymore.

Ya see the pre-export method section in the advanced feature guide @bzAdam linked. Then you can create two separate pre-export methods like:

public static void PreExportVRDisabled() {
    EditorUserBuildSettings.selectedBuildTargetGroup = BuildTargetGroup.StandaloneWindows64;
    PlayerSettings.virutalRealitySupported = false;
}

public static void PreExportVREnabled() {
    EditorUserBuildSettings.selectedBuildTargetGroup = BuildTargetGroup.StandaloneWindows64;
    PlayerSettings.virutalRealitySupported = true;
}

Then just create two targets in Unity Cloud Build and set them up to point to these two different pre-export methods.

Nice, that should work. I didn’t see the advanced features section.