Split crate into shared logic library and binary crate (#52) (#53)

This commit is contained in:
extrawurst
2025-06-29 12:45:25 +02:00
committed by GitHub
parent 5d4c7630ef
commit 7996d632f7
65 changed files with 497 additions and 82 deletions

View File

@@ -0,0 +1,17 @@
use bevy::prelude::*;
#[derive(Component, Reflect)]
#[reflect(Component)]
pub struct AutoRotation(pub Quat);
pub fn plugin(app: &mut App) {
app.register_type::<AutoRotation>();
app.add_systems(FixedUpdate, update_auto_rotation);
}
fn update_auto_rotation(mut query: Query<(&AutoRotation, &mut Transform)>) {
for (auto_rotation, mut transform) in query.iter_mut() {
transform.rotate_local(auto_rotation.0);
}
}