My guess is:
.Log() probably accepts object and does a .ToString().. so it's possible that the an object is being returned but the .ToString() is what is returning null.
سؤال
Here is the issue
public bool Invalid()
{
foreach (FieldInfo fInfo in this.GetType().GetFields())
{
Debug.Log(fInfo.GetValue(this)) //Log Says null
Debug.Log(fInfo.GetValue(this) == null); //Log says false
if (fInfo.GetValue(this) == null) return true; //so this gets skipped
}
return false;
}
The objects in this class are mostly GameObject (unity). I am simply attempting to ensure that the level designer I work with knows if they missed a required GameObject from the scene or not.
المحلول
My guess is:
.Log() probably accepts object and does a .ToString().. so it's possible that the an object is being returned but the .ToString() is what is returning null.