Hot swap configured

This commit is contained in:
2026-03-07 16:03:50 -03:00
parent 1f5797ca31
commit 6bd50a8a95
5 changed files with 6302 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/target

6252
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

24
Cargo.toml Normal file
View File

@@ -0,0 +1,24 @@
[package]
name = "bevy_tutorial"
version = "0.1.0"
edition = "2024"
[profile.dev]
opt-level = 1
[profile.dev.package."*"]
opt-level = 3
[profile.wasm-dev]
inherits = "dev"
opt-level = 1
[profile.server-dev]
inherits = "dev"
[profile.android-dev]
inherits = "dev"
[dependencies]
bevy = { version = "0.18" }
bevy_hotpatching_experiments = "0.4.0"

View File

@@ -0,0 +1,7 @@
# Install
cargo binstall dioxus-cli@0.7.0-alpha.1
# Run with
BEVY_ASSET_ROOT="." dx serve --hot-patch
# or
dx serve --hot-patch

18
src/main.rs Normal file
View File

@@ -0,0 +1,18 @@
use bevy::prelude::*;
use bevy_hotpatching_experiments::prelude::*;
fn main() -> AppExit {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(SimpleSubsecondPlugin::default())
.add_systems(Update, greet)
.run()
}
#[hot]
fn greet(time: Res<Time>) {
info_once!(
"Hello from a hotpatched system! Tryy changing this string while the app is running! Patched at t = {} s",
time.elapsed_secs()
);
}