UIS 1.2.18
Some C# syntactic sugar cannot be directly used to evaluate Unity objects. Refer to https://github.com/microsoft/Microsoft.Unity.Analyzers/blob/main/doc/UNT0008.md for details.
However, I noticed one instance where incorrect syntactic sugar is being used:
UltimateInventorySystem\Scripts\UI\Panels\DisplayPanelManager.cs Line: 294
Should be changed to the following format:
I'm not sure if there are other places in the entire codebase that violate this rule.
Some C# syntactic sugar cannot be directly used to evaluate Unity objects. Refer to https://github.com/microsoft/Microsoft.Unity.Analyzers/blob/main/doc/UNT0008.md for details.
However, I noticed one instance where incorrect syntactic sugar is being used:
UltimateInventorySystem\Scripts\UI\Panels\DisplayPanelManager.cs Line: 294
Code:
var eventSystem = EventSystemManager.GetEvenSystemFor(gameObject);
var currentSelectable = eventSystem.currentSelectedGameObject?.GetComponent<Selectable>();
if (panel.IsMenuPanel == false) {
panel.Open(m_SelectedDisplayPanel, currentSelectable);
return;
}
Should be changed to the following format:
Code:
var eventSystem = EventSystemManager.GetEvenSystemFor(gameObject);
Selectable currentSelectable;
if (eventSystem.currentSelectedGameObject != null)
{
currentSelectable = eventSystem.currentSelectedGameObject.GetComponent<Selectable>();
}
else
{
currentSelectable = null;
}
if (panel.IsMenuPanel == false) {
panel.Open(m_SelectedDisplayPanel, currentSelectable);
return;
}
I'm not sure if there are other places in the entire codebase that violate this rule.