Hello there, my project intends to use Asset Bundles and Addressables to distribute content without needing to create a new app.
Some of these assets will be Prefabs, and they will have a FlowScript Controller in them.
Currently, the ZoomFactor and Translation of the viewport of FlowScript Canvas is serialized in the prefab. This means that just by looking inside the Graph I will have a change in my prefab (check picture) and this means that the hash for my asset bundle will change!
This is pretty bad for my use case, as my players will have to redownload the bundles even if nothing really changed in them, only the zoom level that is only relevant in editor time. (check picture)
Is there a way to not serialize these fields? I couldn’t find anything in the FlowCanvas configuration.
I initially opted to serialize translation and zoom so that it is saved with the graph and thus a graph opens up at the same translation/zoom that it was left at. Furthermore serializing translation and zoom also allows for them to be part of an Undo (and thus being more clear what was undoed). With that said, you can open the GraphSource.cs and remove the serialization attributes from the ‘_translation’ and ‘_zoomFactor’ fields to not serialize them. I will also look into this and possibly change them to be serialized in EditorPrefs instead.
Hey Gavalakis, thanks for the reply.
I totally understand the motivation behind serializing these fields, and I appretiate if you look into use EditorPrefs, or any other solution to solve the problem. It may be worth checking how Unity Visual Scripting does it, or how other plugins do it. I believe Behaviour Designer solved this problem without serializing it to the Prefab object directly.
And for the solution to comment out the attributes, it works for new graphs, but it totally breaks all previous Graphs I had :/
I tried to drill down and check how to prevent this to be perceived as an error, but I couldn’t. Maybe you cna shed some light here?
Interesting development.
I decided to move forward and redo all my graphs and to my surprise, the second time I commented the serialization the Canvas window didn’t complain about bad serialization.
All seems good now. I will update this thread if it starts complaining again.
Author
Posts
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.