I have defined the class ‘Object’ in my namespace.
And I have added a serialized field, of which type is the class ‘Object’.
In that case, I cannot attach a gameObject to the field in Unity editor.
namespace Custom.Space
{
public class Object : MonoBehaviour
{
}
public class B : MonoBehaviour
{
[SerializeField] private Object object;
}
}
It seems that the name of the class, ‘Object’ cannot be used as a type of a SerializeField
If I have changed the name of class ‘Object’ with another name like’ BaseObject’, it works.