mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
Reduce noise in asset processing example (#10262)
# Objective - Reduce noise to allow users to see previous asset changes and other logs like from asset reloading - The example file is named differently than the example ## Solution - Only print the asset content if there are asset events - Rename the example file to `asset_processing`
This commit is contained in:
parent
442a316a1d
commit
317903f42a
3 changed files with 20 additions and 13 deletions
|
@ -1102,7 +1102,7 @@ wasm = true
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "asset_processing"
|
name = "asset_processing"
|
||||||
path = "examples/asset/processing/processing.rs"
|
path = "examples/asset/processing/asset_processing.rs"
|
||||||
doc-scrape-examples = true
|
doc-scrape-examples = true
|
||||||
required-features = ["file_watcher", "asset_processor"]
|
required-features = ["file_watcher", "asset_processor"]
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ Example | Description
|
||||||
Example | Description
|
Example | Description
|
||||||
--- | ---
|
--- | ---
|
||||||
[Asset Loading](../examples/asset/asset_loading.rs) | Demonstrates various methods to load assets
|
[Asset Loading](../examples/asset/asset_loading.rs) | Demonstrates various methods to load assets
|
||||||
[Asset Processing](../examples/asset/processing/processing.rs) | Demonstrates how to process and load custom assets
|
[Asset Processing](../examples/asset/processing/asset_processing.rs) | Demonstrates how to process and load custom assets
|
||||||
[Custom Asset](../examples/asset/custom_asset.rs) | Implements a custom asset loader
|
[Custom Asset](../examples/asset/custom_asset.rs) | Implements a custom asset loader
|
||||||
[Custom Asset IO](../examples/asset/custom_asset_reader.rs) | Implements a custom AssetReader
|
[Custom Asset IO](../examples/asset/custom_asset_reader.rs) | Implements a custom AssetReader
|
||||||
[Hot Reloading of Assets](../examples/asset/hot_asset_reloading.rs) | Demonstrates automatic reloading of assets when modified on disk
|
[Hot Reloading of Assets](../examples/asset/hot_asset_reloading.rs) | Demonstrates automatic reloading of assets when modified on disk
|
||||||
|
|
|
@ -217,15 +217,22 @@ fn setup(mut commands: Commands, assets: Res<AssetServer>) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_text(handles: Res<TextAssets>, texts: Res<Assets<Text>>) {
|
fn print_text(
|
||||||
// This prints the current values of the assets
|
handles: Res<TextAssets>,
|
||||||
// Hot-reloading is supported, so try modifying the source assets (and their meta files)!
|
texts: Res<Assets<Text>>,
|
||||||
println!("Current Values:");
|
mut asset_events: EventReader<AssetEvent<Text>>,
|
||||||
println!(" a: {:?}", texts.get(&handles.a));
|
) {
|
||||||
println!(" b: {:?}", texts.get(&handles.b));
|
if !asset_events.is_empty() {
|
||||||
println!(" c: {:?}", texts.get(&handles.c));
|
// This prints the current values of the assets
|
||||||
println!(" d: {:?}", texts.get(&handles.d));
|
// Hot-reloading is supported, so try modifying the source assets (and their meta files)!
|
||||||
println!(" e: {:?}", texts.get(&handles.e));
|
println!("Current Values:");
|
||||||
println!("(You can modify source assets and their .meta files to hot-reload changes!)");
|
println!(" a: {:?}", texts.get(&handles.a));
|
||||||
println!();
|
println!(" b: {:?}", texts.get(&handles.b));
|
||||||
|
println!(" c: {:?}", texts.get(&handles.c));
|
||||||
|
println!(" d: {:?}", texts.get(&handles.d));
|
||||||
|
println!(" e: {:?}", texts.get(&handles.e));
|
||||||
|
println!("(You can modify source assets and their .meta files to hot-reload changes!)");
|
||||||
|
println!();
|
||||||
|
asset_events.clear();
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue