From b418dc610492995d037b7b1e6feba1a0149237e8 Mon Sep 17 00:00:00 2001 From: DoctorGester Date: Wed, 7 May 2025 00:23:27 +0200 Subject: [PATCH] Replace ternary with a regular condition --- dist/platforms/windows/build.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dist/platforms/windows/build.ps1 b/dist/platforms/windows/build.ps1 index f0c3702c..ac78d62b 100644 --- a/dist/platforms/windows/build.ps1 +++ b/dist/platforms/windows/build.ps1 @@ -148,13 +148,20 @@ Write-Output "# Building project #" Write-Output "###########################" Write-Output "" +$unityGraphics = "-nographics" + +if ($LLVMPIPE_INSTALLED -eq "true") +{ + $unityGraphics = "-force-opengl" +} + # If $Env:CUSTOM_PARAMETERS contains spaces and is passed directly on the command line to Unity, powershell will wrap it # in double quotes. To avoid this, parse $Env:CUSTOM_PARAMETERS into an array, while respecting any quotations within the string. $_, $customParametersArray = Invoke-Expression('Write-Output -- "" ' + $Env:CUSTOM_PARAMETERS) $unityArgs = @( "-quit", "-batchmode", - ($Env:LLVMPIPE_INSTALLED -eq "true" ? "-force-opengl" : "-nographics"), + $unityGraphics, "-silent-crashes", "-customBuildName", "`"$Env:BUILD_NAME`"", "-projectPath", "`"$Env:UNITY_PROJECT_PATH`"",