# before compiling:
# the mod's packages, only those .u files will be copied to the output
[System.String[]]$thismodpackages = Get-ChildItem "$modSrcRoot/Src"
# in the clean up when a full rebuild is not forced:
# clean mod's compiled script
Write-Host "Cleaning existing mod's compiled script from $sdkPath/XComGame/Script..."
for ($i=0; $i -lt $thismodpackages.length; $i++) {
MaybeDelete -path "$sdkPath\XComGame\Script\$thismodpackages[$i].u"
}
Write-Host "Cleaned."
#when copying compiled packages:
# copy compiled mod scripts to the staging area
Write-Host "Copying the compiled mod scripts to staging..."
for ($i=0; $i -lt $thismodpackages.length; $i++) {
$name = $thismodpackages[$i]
Copy-Item "$sdkPath/XComGame/Script/$name.u" "$stagingPath/Script" -Force -WarningAction SilentlyContinue
Write-Host "$sdkPath/XComGame/Script/$name.u"
}
Write-Host "Copied compiled script packages."
Snippet from robojumper to get started with: