- Home /
How do I pass serialized ScriptableObjects between Unity projects?
I have two Unity projects, one that creates asset bundles, and another that consumes them. The problem is that I need to pass a TOC object (a list of other asset bundles and their contents) as well. Obviously, I pack it into a separate asset bundle and store that at a predetermined (hardcoded) location. But whe I get this asset bundle in another project, the main asset is null. The precise reason is not that hard to deduce: it seems that the ScriptableObject identifies itself for serialization with some kind of internal ID, and these IDs are not the same in the two projects.
So the question is: Is there a way to explicitly specify an association between the two classes in the two projects, so that I am able to pass the data in the aforementioned way, or do I have to write my own serialization (or replacement thereof)?
Having the same issue. I'm using ScriptableObjects as configuration files for my editor extension. Actually they should be loaded in every new project, but they aren't. Have you found a solution?
Answer by Proclyon · Nov 16, 2010 at 02:45 PM
Have you considered doing a bypass? Try blocking the automated process of serialization by a conversion into any container or datatype that you can fit everything in, or by slushing it through the unity engine library , but a whole other story.
As far as bad idea's go I'm afraid you will be stuck with self made serialization. It's a lot of work but it's better than nothing. Sorry I can't supply you with much more, my knowledge on this is limited
Old old post btw, any news ? Did you get it working? If so, what did you do ?
Self-made serialization could be built on the System.Xml namespace, so you don't actually need to roll much code, just a management layer, but not the serializer itself. I'd be interested in the results too, so let us know.
Answer by Max Kaufmann · Dec 13, 2010 at 03:06 AM
Do they need to be two projects? Serialization is just the first wall you're going to run up against because the asset bundles are going to depend on undefined GUIDs.