You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Language Usage Opportunities, should be able to differentiate between unity objects and pure c# objects.
Currently all contexts where the following pattern exists will be flagged up by the code analyser.
However if the case is that Unity objects are included this should be suppressed.
Convert the following code:
if (condition) x = expr1;
else x = expr2;
To:
x = condition ? expr1 : expr2;
The text was updated successfully, but these errors were encountered:
This is a fairly old issue, but the above code is completely fine with UnityEngine.Object types. A ternary statement is just a fancy-looking if statement. It's not related to any of the things that make UnityEngine.Object types weird, like Unity null.
Perhaps there's something else about this issue that I'm missing.
Language Usage Opportunities, should be able to differentiate between unity objects and pure c# objects.
Currently all contexts where the following pattern exists will be flagged up by the code analyser.
However if the case is that Unity objects are included this should be suppressed.
Convert the following code:
if (condition) x = expr1;
else x = expr2;
To:
x = condition ? expr1 : expr2;
The text was updated successfully, but these errors were encountered: