feat: update example to bevy 14.1

This commit is contained in:
2024-08-12 23:45:25 +00:00
parent 1defbfc1c9
commit 815891ed33
5 changed files with 716 additions and 526 deletions
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -12,9 +12,10 @@ wayland = ["bevy/wayland"]
windows = ["bevy/bevy_winit"] windows = ["bevy/bevy_winit"]
[dependencies] [dependencies]
bevy = { version = "0.13.2", default-features = false, features = [ bevy = { version = "0.14.1", default-features = false, features = [
"bevy_asset", "bevy_asset",
"bevy_text", "bevy_text",
"bevy_state",
"bevy_ui", "bevy_ui",
"dynamic_linking", "dynamic_linking",
"default_font", "default_font",
+3 -6
View File
@@ -43,19 +43,16 @@
}, },
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1712196778, "lastModified": 1723429325,
"narHash": "sha256-SOiwCr2HtmYpw8OvQQVRPtiCBWwndbIoPqtsamZK3J8=", "narHash": "sha256-4x/32xTCd+xCwFoI/kKSiCr5LQA2ZlyTRYXKEni5HR8=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "20e7895d1873cc64c14a9f024a8e04f5824bed28", "rev": "65e3dc0fe079fe8df087cd38f1fe6836a0373aad",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1,2 +1,2 @@
[toolchain] [toolchain]
channel = '1.76.0' channel = '1.79.0'
@@ -7,7 +7,7 @@
// TODO strum redefine in bevy_controls // TODO strum redefine in bevy_controls
use bevy::{ecs::schedule::States, prelude::*}; use bevy::prelude::*;
use bevy_controls::{ use bevy_controls::{
contract::InputsContainer, contract::InputsContainer,
plugin::ControlsPlugin, plugin::ControlsPlugin,
@@ -265,7 +265,7 @@ fn text_update_system(
fn update_text(mut text: Mut<Text>, input_value: InputValue, index: usize) -> Mut<Text> { fn update_text(mut text: Mut<Text>, input_value: InputValue, index: usize) -> Mut<Text> {
if input_value.is_boolean() && input_value.to_boolean() { if input_value.is_boolean() && input_value.to_boolean() {
text.sections[index].style.color = Color::GOLD; text.sections[index].style.color = Color::linear_rgb(0.855, 0.647, 0.125);
} else { } else {
text.sections[index].style.color = Color::WHITE; text.sections[index].style.color = Color::WHITE;
} }