-
Notifications
You must be signed in to change notification settings - Fork 45
UnityProjectInstance fixed for older Unity versions #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnityProjectInstance fixed for older Unity versions #212
Conversation
…lder versions of Unity
UnitySetup/UnitySetup.psm1
Outdated
Write-Warning -Message "Exception Message: $($_.Exception.Message)" | ||
} | ||
finally{ | ||
$prodName = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by doing this in finally
, $prodName
will always end up as the empty string. I'd move this line up into the end of the catch
block and probably set it to $null
instead of the empty string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple of ideas for improvements. =)
UnitySetup/UnitySetup.psm1
Outdated
if (!$prodName) { throw "ProjectSettings is missing productName" } | ||
} | ||
catch { | ||
Write-Warning -Message "An Exception was caught!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's reasonable to print the exception, but since we know the issue you're seeing will be common, we should point that out with a message something akin to, "Could not read $projectSettingsFile, have you set your meta files to "Force Text"".
UnitySetup/UnitySetup.psm1
Outdated
catch { | ||
Write-Warning -Message "An Exception was caught!" | ||
Write-Warning -Message "Exception Type: $($_.Exception.GetType().FullName)" | ||
Write-Warning -Message "Exception Message: $($_.Exception.Message)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use newlines to log these warnings? Otherwise they'll show up at three warnings when actually there's one.
Versions such as 5.6.0f3 do not have projectsettings.asset files that can be read in the same way as newer versions of Unity.