I have a Unity game using WebGL and c#.
I am running Unity 2020.2.6f1, from what I understand is using c# 7.3
I currently check for null or empty arrays like this:
ObjectType[] myObjectTypeList = FindObjectsOfType<ObjectType>();
if(myObjectTypeList != null && myObjectTypeList.Length > 0)
{
...
}
But I read that in c# 7+ you can shorten to this:
if(!(myObjectTypeList?.Length != 0))
{
...
}
Is this something I can do in a Unity c# script when I am using FindObjectsOfType?
Thanks!