File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1414 RootModule = ' UnitySetup'
1515
1616 # Version number of this module.
17- ModuleVersion = ' 5.3 '
17+ ModuleVersion = ' 5.4 '
1818
1919 # Supported PSEditions
2020 # CompatiblePSEditions = @()
Original file line number Diff line number Diff line change @@ -125,8 +125,19 @@ class UnityProjectInstance {
125125 $projectSettingsFile = [io.path ]::Combine($path , " ProjectSettings\ProjectSettings.asset" )
126126 if (! (Test-Path $projectSettingsFile )) { throw " Project is missing ProjectSettings.asset" }
127127
128- $prodName = ((Get-Content $projectSettingsFile - Raw | ConvertFrom-Yaml )[' playerSettings' ])[' productName' ]
129- if (! $prodName ) { throw " ProjectSettings is missing productName" }
128+ try {
129+ $prodName = ((Get-Content $projectSettingsFile - Raw | ConvertFrom-Yaml )[' playerSettings' ])[' productName' ]
130+ if (! $prodName ) { throw " ProjectSettings is missing productName" }
131+ }
132+ catch {
133+ $msg = " Could not read $projectSettingsFile , in the Unity project try setting Editor Settings > Asset Serialiazation Mode to 'Force Text'."
134+ $msg += " `n An Exception was caught!"
135+ $msg += " `n Exception Type: $ ( $_.Exception.GetType ().FullName) "
136+ $msg += " `n Exception Message: $ ( $_.Exception.Message ) "
137+ Write-Warning - Message $msg
138+
139+ $prodName = $null
140+ }
130141
131142 $this.Path = $path
132143 $this.Version = $fileVersion
You can’t perform that action at this time.
0 commit comments