Skip to content
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

Merged
merged 2 commits into from Sep 27, 2023
Merged

nullable warnings #568

merged 2 commits into from Sep 27, 2023

Conversation

JoC0de
Copy link
Collaborator

@JoC0de JoC0de commented Sep 24, 2023

  • 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
@JoC0de JoC0de self-assigned this Sep 24, 2023
@JoC0de JoC0de mentioned this pull request Sep 24, 2023
@JoC0de JoC0de requested a review from igor84 September 24, 2023 13:36
Copy link
Collaborator

@igor84 igor84 left a 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]
Copy link
Collaborator

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?

Copy link
Collaborator Author

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'.

@JoC0de
Copy link
Collaborator Author

JoC0de commented Sep 25, 2023

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?

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 😄

@igor84
Copy link
Collaborator

igor84 commented Sep 25, 2023

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...

@JoC0de
Copy link
Collaborator Author

JoC0de commented Sep 27, 2023

I will just merge this. We can easily (with one click) convert them to nullable reference types if we update Unity.

@JoC0de JoC0de merged commit 1138f26 into GlitchEnzo:master Sep 27, 2023
8 checks passed
@JoC0de JoC0de deleted the feature/fix-warnings branch September 27, 2023 20:00
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.

None yet

2 participants