Public
This commit is contained in:
parent
7099b8629d
commit
feb72f9d32
2 changed files with 4 additions and 4 deletions
|
|
@ -9,12 +9,12 @@ impl Plugin for CollisionPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct Collider(f32);
|
pub struct Collider(pub f32);
|
||||||
|
|
||||||
#[derive(EntityEvent)]
|
#[derive(EntityEvent)]
|
||||||
pub struct Collided {
|
pub struct Collided {
|
||||||
entity: Entity,
|
pub entity: Entity,
|
||||||
with: Entity,
|
pub with: Entity,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn calculate_collisions(mut commands: Commands, query: Query<(Entity, &Transform, &Collider)>) {
|
fn calculate_collisions(mut commands: Commands, query: Query<(Entity, &Transform, &Collider)>) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
use crate::collision::CollisionPlugin;
|
use crate::collision::{Collided, Collider, CollisionPlugin};
|
||||||
use crate::damagable::DamagablePlugin;
|
use crate::damagable::DamagablePlugin;
|
||||||
|
|
||||||
mod collision;
|
mod collision;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue