font and cash ui
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
use crate::{camera::GameCameraRig, cash::Cash, tb_entities::SpawnPoint};
|
||||
use crate::{
|
||||
camera::GameCameraRig,
|
||||
cash::{Cash, CashCollectEvent},
|
||||
tb_entities::SpawnPoint,
|
||||
};
|
||||
use avian3d::prelude::*;
|
||||
use bevy::{
|
||||
input::mouse::MouseMotion,
|
||||
@@ -170,7 +174,6 @@ fn collect_cash(
|
||||
mut collision_event_reader: EventReader<CollisionStarted>,
|
||||
query_player: Query<&Player>,
|
||||
query_cash: Query<&Cash>,
|
||||
asset_server: Res<AssetServer>,
|
||||
) {
|
||||
for CollisionStarted(e1, e2) in collision_event_reader.read() {
|
||||
let collect = if query_player.contains(*e1) && query_cash.contains(*e2) {
|
||||
@@ -182,7 +185,7 @@ fn collect_cash(
|
||||
};
|
||||
|
||||
if let Some(cash) = collect {
|
||||
commands.spawn(AudioPlayer::new(asset_server.load("sfx/effects/cash.ogg")));
|
||||
commands.trigger(CashCollectEvent);
|
||||
commands.entity(cash).despawn();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user