forked from emipa606/AssetBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexampleBuildScript.ps1
More file actions
32 lines (28 loc) · 857 Bytes
/
exampleBuildScript.ps1
File metadata and controls
32 lines (28 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$unityPath = $env:UNITY_PATH
$buildTarget = $Env:UNITY_BUILD_TARGET
if ( [string]::IsNullOrEmpty($unityPath))
{
Write-Host "Set your UNITY_PATH environment variable"
exit
}
if ( [string]::IsNullOrEmpty($buildTarget))
{
Write-Host "Set your UNITY_BUILD_TARGET environment variable (windows, mac, linux)"
exit
}
$unityArgs = @(
"-batchmode",
"-quit",
'-projectPath="C:\AssetBuilder"',
"-executeMethod=ModAssetBundleBuilder.BuildBundles",
"-buildTarget=$buildTarget",
"-source=C:\Users\author\mymod"
)
Write-Host " Building asset bundle: $bundleName"
$process = Start-Process $unityPath -ArgumentList $unityArgs -Wait -PassThru
if ($process.ExitCode -ne 0)
{
Write-Host " Unity failed for $mod (exit code $( $process.ExitCode )). Crashing build."
exit
}
Write-Host " Finished generating assetbundle"