Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add writing of scene data to Scene example (bevyengine#5949)
# Objective Alice says to make this PR: https://discord.com/channels/691052431525675048/745805740274614303/1018554340841107477 - The "scene" example in the examples folder has a TODO comment about writing the serialized data to a file. This PR implements that. ## Solution The `AssetIo` trait in the `AssetServer` only supports reading data, not writing it. So, I used `std::io::File` for the implementation. This way, every time you run the example, it will mutate the file in-place. I had thought about adding a UUID string to the example Component, so that every time you run the example, the file will be guaranteed to change (currently, it just writes the same numbers over and over). However, I didn't bother because it was beyond the scope of the TODO comment. One thing to note is that the logic for serializing the scene into RON data has changed since the existing RON file was created, and so even though the data is the same, it's rendered in a different order for whatever reason. I left the changed output to the example file, because it's presumably trivial. I can remove it and force-push if you don't want that included in here.
- Loading branch information