-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure out deserialization mapping of non-public fields #25
Comments
Yuck. Got some more deserialization working to get the fileIDs at least read in, but it's an abomination! kitsilanosoftware/BosphorusEngine@1d8ef29 I think that the file-format that Unity are using here is really non-idiomatic YAML. In particular, this in GameObject: m_Component:
Actually appears to be a sequence of mappings of mappings, and the outer mapping is NOT using a consistent key name. The key value (the object type) is actually being used as a key. Maybe this is some manifestation of their underlying C++ code? Whatever the case, it is just horrible. I did something horrific to get the data read in, and will have to try to simplify it now I now what the events are being mapped as. Or maybe I will just shelve that horror for now and move onto getting the runtime fixing up the references and actually running a bit. I see that the YAML also has fileIDs which aren't listed in the YAML itself, which are presumably for external assets, like the script code, meshes, etc. I found something online describing the hashing used for fileID, which is some hash of the object type name and object name concatenated. |
Hi Bob,
Sounds good!
Well, one step at a time :) This doesn't look bad at a glance; the only
C++: most probably. The serialization format doesn't seem to have been
I, for one, would try to get something useful running ASAP, because
Really? "fileID"s seem to be 32-bit integers; they would need to Cheers, -D |
Ah, yes, I misspoke slightly. The reference I saw was for this "fileID" only ... m_Script: {fileID: -1167294237, guid: 2b16a1acf52a2a64e916f8a9e6d5df31, type: 3} http://forum.unity3d.com/threads/yaml-fileid-hash-function-for-dll-scripts.252075/ |
Some YAML files refer to internal properties which are not directly exposed in the .NET API, but that data is most probably necessary to properly implement some of the public method or global behaviours.
As an example,
ParticleSystem
only exposes a small set of properties, but its serialization includes a large list of "modules" which determine its exact behaviour at runtime:Note the elision marker. The
*Module
subtree actually spans 1013 lines!The text was updated successfully, but these errors were encountered: