pickup shows in toolbar

This commit is contained in:
LorrensP-2158466
2025-04-06 16:31:32 +02:00
10 changed files with 349 additions and 59 deletions

View File

@@ -1,7 +1,12 @@
use bevy::{prelude::*, reflect::DynamicTypePath};
use bevy::{image, prelude::*, reflect::DynamicTypePath};
use bevy_rapier3d::prelude::*;
use crate::{GameState, asset_loading::GltfAssets, interaction::Interact};
use crate::{
GameState,
asset_loading::{GltfAssets, ImageAssets},
interaction::Interact,
player::toolbar::ItemIcon,
};
pub fn map_plugin(app: &mut App) {
app.add_systems(
@@ -112,7 +117,12 @@ fn spawn_level(mut commands: Commands, models: Res<Assets<Gltf>>, gltf_assets: R
));
}
fn spawn_objects(mut commands: Commands, models: Res<Assets<Gltf>>, gltf_assets: Res<GltfAssets>) {
fn spawn_objects(
mut commands: Commands,
models: Res<Assets<Gltf>>,
gltf_assets: Res<GltfAssets>,
image_assets: Res<ImageAssets>,
) {
// let hammer = gltf_assets
// .library
// .get("meshes/library/hammer.glb")
@@ -147,6 +157,7 @@ fn spawn_objects(mut commands: Commands, models: Res<Assets<Gltf>>, gltf_assets:
Interact,
RigidBody::Dynamic,
Name::new("Id Card"),
ItemIcon::new(image_assets.id_card.clone()),
SceneRoot(asset.clone()),
))
.with_children(|parent| {