UnityObjectExtensions.IsNull<T> and UnityEngine.Object null checking #11847
|
Hi! A quick question about UnityObjectExtensions.IsNull. In the comment (if I understood it correctly), it says that it checks a UnityEngine.Object for null (using the overloaded operator) when passed through an interface. But the implementation doesn't match the comment. Often, errors occur when the author assumes what's described in the comment, but in reality, it only checks the interface itself for null. How was it actually intended to work? As described in the comment or as implemented? |
Answered by
artembelaev
May 14, 2025
Replies: 1 comment
|
Sorry, it works because object.Equals is virtual (https://learn.microsoft.com/ru-ru/dotnet/api/system.object.equals?view=net-8.0) and UnityEngine.Object overrides it. |
0 replies
Answer selected by
artembelaev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, it works because object.Equals is virtual (https://learn.microsoft.com/ru-ru/dotnet/api/system.object.equals?view=net-8.0) and UnityEngine.Object overrides it.