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 14
14
RootModule = ' UnitySetup'
15
15
16
16
# Version number of this module.
17
- ModuleVersion = ' 5.3 '
17
+ ModuleVersion = ' 5.4 '
18
18
19
19
# Supported PSEditions
20
20
# CompatiblePSEditions = @()
Original file line number Diff line number Diff line change @@ -125,8 +125,19 @@ class UnityProjectInstance {
125
125
$projectSettingsFile = [io.path ]::Combine($path , " ProjectSettings\ProjectSettings.asset" )
126
126
if (! (Test-Path $projectSettingsFile )) { throw " Project is missing ProjectSettings.asset" }
127
127
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
+ }
130
141
131
142
$this.Path = $path
132
143
$this.Version = $fileVersion
You can’t perform that action at this time.
0 commit comments