public static UnityObjectHandle ToObjectHandle(Object obj)
        {
            var handle = new UnityObjectHandle();

            if (!obj || null == obj)
            {
                return(handle);
            }

#if UNITY_EDITOR
            var json = UnityEditor.EditorJsonUtility.ToJson(new Container {
                o = obj
            });
            json = json.Substring(5, json.Length - 6);

            var reader = new JsonObjectReader(json);
            reader.ReadBeginObject();
            reader.ReadPropertyNameSegment(); // fileID
            handle.FileId = reader.ReadInt64();
            reader.ReadValueSeparator();
            reader.ReadPropertyNameSegment(); // guid
            handle.Guid = reader.ReadString();
            reader.ReadValueSeparator();
            reader.ReadPropertyNameSegment(); // type
            handle.Type = reader.ReadInt32();
            reader.ReadValueSeparator();
#endif
            return(handle);
        }