mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
f83a9c23f2
# 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.
12 lines
198 B
Text
12 lines
198 B
Text
/target
|
|
crates/*/target
|
|
**/*.rs.bk
|
|
Cargo.lock
|
|
.cargo/config
|
|
.cargo/config.toml
|
|
/.idea
|
|
/.vscode
|
|
/benches/target
|
|
|
|
# Generated by "examples/scene/scene.rs"
|
|
assets/scenes/load_scene_example-new.scn.ron
|