Component OnAwake or OnEnable with PropertyAttribute

I’m trying to create helper attribute, that’ll check specific field is set in inspector (or maybe there is some solution already?)
For instance, default check for “Not null”:

private GameObject _prefabReference;

And I need to detect “Awake()” of this component from PropertyAttribute or PropertyDrawer and do something like this:

Awake() {
        "Field of type " + typeof(_referencedField).Name + " is null");

For now I’m use assertions in Awake, but sometimes it’s hard to track all fields I need:


Haha somehow google lead me to my own question over the years so I’ll decided to update it with solution I made after all:



This attribute tracks nullrefs, empty strings, arrays and value types with default values on game start (in editor)
alt text