Nameof()

Wouldn’t it be better to use nameof() when getting the property of the serializedObject since we are using the same class.

var serializedObject = new SerializedObject(this);
var property = serializedObject.FindProperty(nameof(uniqueIdentifier));
3 Likes

Generally, yes. It’s probably not something Sam thought of right away since in this case we’re using SerializedObject outside of a traditional Editor/OnInspectorGUI setting.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms