Updated to Bevy 0.15.1

This commit is contained in:
2025-01-13 21:43:50 -05:00
parent 8e2dc04a6f
commit 5b4e96177c
28 changed files with 1232 additions and 1090 deletions
+1 -1
View File
@@ -13,6 +13,6 @@ impl Plugin for SimpleAnimationPlugin {
fn rotate(mut query: Query<(&mut Transform, &RotationAnimation)>, time: Res<Time>) {
for (mut transform, rot) in query.iter_mut() {
let cur_rot = transform.rotation;
transform.rotation = cur_rot * Quat::from_axis_angle(rot.axis, rot.speed.to_radians() * time.delta_seconds());
transform.rotation = cur_rot * Quat::from_axis_angle(rot.axis, rot.speed.to_radians() * time.delta_secs());
}
}
+1 -1
View File
@@ -24,7 +24,7 @@ impl Plugin for DespawnPuglin {
fn despawn_at(mut commands: Commands, time: Res<Time>, entities: Query<(Entity, &DespawnAt), Without<DespawnAfter>>) {
for (entity, at) in entities.iter() {
let d = at.0 - time.elapsed_seconds();
let d = at.0 - time.elapsed_secs();
commands
.entity(entity)
.insert(DespawnAfter(Timer::from_seconds(d, TimerMode::Once)));
+5 -6
View File
@@ -19,17 +19,16 @@ impl PrefabDefination {
let mesh_handle = &gltf.named_meshes[&self.path.clone().into_boxed_str()];
if let Some(gltf_mesh) = meshes.get(mesh_handle.id()) {
let (m, mat) = gltf_mesh.unpack();
let mut entity = commands.spawn(PbrBundle {
mesh: m,
material: mat,
transform: Transform::from_translation(self.pos).with_rotation(Quat::from_euler(
let mut entity = commands.spawn((
Mesh3d(m),
MeshMaterial3d(mat),
Transform::from_translation(self.pos).with_rotation(Quat::from_euler(
bevy::math::EulerRot::XYZ,
self.rot.x,
self.rot.y,
self.rot.z,
)),
..Default::default()
});
));
if let Some(children) = &self.children {
entity.with_children(|b| {
for child in children {