embed assets into binary only in release builds

This commit is contained in:
yuni 2024-03-22 12:06:03 +01:00
parent a0031603e5
commit d2bb8d447c

View file

@ -14,10 +14,16 @@ use bevy::prelude::*;
use bevy_embedded_assets::{EmbeddedAssetPlugin, PluginMode};
fn main() {
App::new().add_plugins((
EmbeddedAssetPlugin { mode: PluginMode::ReplaceDefault },
OutFlyPlugin,
)).run();
if cfg!(debug_assertions) {
App::new().add_plugins((
OutFlyPlugin,
)).run();
} else {
App::new().add_plugins((
EmbeddedAssetPlugin { mode: PluginMode::ReplaceDefault },
OutFlyPlugin,
)).run();
}
}
pub struct OutFlyPlugin;