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? |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
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.