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
nullable warnings #568
nullable warnings #568
Conversation
JoC0de
commented
Sep 24, 2023
•
edited
edited
- annotate code with resharper nullable attributes. We can't use nullable reference types until we update / set minimum required version to Unity 2020.2
- add missing null-checks / cases
- extract update checker form NugetWindow
- rename asmdef
…ecks / cases + extract update ckecker form NugetWindow + rename asmdef
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.
Nice work. It is sad we can't just use nullable reference types since they are only available since Unity 2020, I think. BTW. How do we decide when we can move the minimal supported version up?
private Texture2D icon; | ||
|
||
[ItemCanBeNull] | ||
[CanBeNull] | ||
[NonSerialized] |
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.
Why do you need NonSerialized
attribute on private field?
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 was getting the warning CA2235:Mark all non-serializable fields without. I think the warning is not Unity related and doesn't apply to Unity. But I also found it useful for 'clarification'.
I don't know. I also thought about it. Are there any statistics of which versions are actively used? Just googled it but i could only found some really old stats. I don't know how games handle Unity updates if they work for years before releasing the Game and also maintaining / updating the game constantly, are they freezed on one Unity version? I am not a Game developer 😄 |
There are probably all kind of use cases. In my company where we develop mobile games we are mostly trying to update to new LTS within six months from release. Some old games that are not maintained any more are on older version but we don't actually open them in Unity any more. Plus even if we wanted to build a new release of some old game we would probably have to update Unity first because of all the yearly breaking changes by Android and iOS. On the other hand, desktop games probably don't have such hard limits to push them to update Unity so I would expect a lot of them get stuck on some old version where they have last seen active development. Anyway 2022 LTS was released this year which I think means that 2020 LTS is no longer supported since Jun and since we are supporting from 2018 that means we are supporting last 3 releases that are not supported by Unity any more. When I put it like this it sounds reasonable. We could reduce it to 2 such releases but probably not more... |
I will just merge this. We can easily (with one click) convert them to nullable reference types if we update Unity. |