Skip to content

fix: NetcodeSettingsProvider Exception [MTT-5217]#2345

Merged
NoelStephensUnity merged 5 commits intodevelopfrom
fix/netcodesettingsprovider-exception-mtt-5217
Dec 12, 2022
Merged

fix: NetcodeSettingsProvider Exception [MTT-5217]#2345
NoelStephensUnity merged 5 commits intodevelopfrom
fix/netcodesettingsprovider-exception-mtt-5217

Conversation

@NoelStephensUnity
Copy link
Copy Markdown
Member

Since UI Element helper classes were being instantiated when they were declared, when entering into play mode, in unity 2020.3.x versions, the EditorStyles.label was not yet assigned and would throw an exception (in 2021 and later versions EditorStyles.label is assigned at that point in time). This PR resolves the issue by instantiating the helper classes when OnGuiHandler is invoked.

MTT-5217

Changelog

  • Fixed: Issue where NetcodeSettingsProvider would throw an exception in Unity 2020.3.x versions.

Testing and Documentation

  • No tests have been added.
  • No documentation changes or additions were necessary.

This fixes the exception in 2020.3.x versions of Unity where the EditorStyles.label is not yet set when instantiating label and toggle elements during declaration (unlike later versions of Unity where it does).
adding one more comment
MTT-5217
Removing some changes that I had added when trying to narrow down where this issue was happening in 2020.3.x versions of Unity.
MTT-5217
Adding changelog entry.
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review December 12, 2022 15:56
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner December 12, 2022 15:56
{
m_LabelContent = labelText;
AdjustLableSize(labelText, layoutOffset);
AdjustLabelSize(labelText, layoutOffset);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) December 12, 2022 16:29
@NoelStephensUnity NoelStephensUnity merged commit b8f3929 into develop Dec 12, 2022
@NoelStephensUnity NoelStephensUnity deleted the fix/netcodesettingsprovider-exception-mtt-5217 branch December 12, 2022 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants