From d2bb8d447c6e70e51628021c7728e2952376a3bd Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 22 Mar 2024 12:06:03 +0100 Subject: [PATCH] embed assets into binary only in release builds --- src/main.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index bce4183..f787f90 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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;