Hot swap configured
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/target
|
||||
6252
Cargo.lock
generated
Normal file
6252
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
24
Cargo.toml
Normal file
24
Cargo.toml
Normal 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"
|
||||
@@ -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
18
src/main.rs
Normal 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()
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user