When I call new SerializedObject(obj) where 'obj' is a UnityEngine.Object instance, as I understand it this is what it does:
Each serializable property of the object is traversed, and its sub-properties recursively. If the property is a reference to a UnityEngine.Object, it serializes the reference, not the object (simply its GUID or instanceID).
However, what if I want to serialize a single property like a UnityEngine.Object reference? There must be an internal method for serializing/deserializing values, but I don't know what it is or if there's possibly a better way.
This was brought about when I wanted to store a UnityEngine.Object reference as a string, so I could load it later on as an Object. This got me thinking that the only way I could achieve this was to contain the reference within another UnityEngine.Object and serialize that, but this struck me as quite an odd approach.
I've also encountered an unusual scenario where I had a very complex and dense serializable object, but I only wanted a single SerializedProperty. The only way it seemed was to serialize the entire object, causing noticeable lag which could have been prevented were there a more appropriate method.
So... to phrase my question succinctly, how do I serialize a single property (including UnityEngine.Object refs) without using SerializedObject or EditorJSONUtility?