more asset loader usage
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
GameState,
|
||||
alien::{ALIEN_ASSET_PATH, Animations},
|
||||
alien::Animations,
|
||||
camera::{CameraArmRotation, CameraTarget},
|
||||
cash::{Cash, CashCollectEvent},
|
||||
control::{
|
||||
@@ -8,6 +8,7 @@ use crate::{
|
||||
controller::{CharacterControllerBundle, PlayerMovement},
|
||||
},
|
||||
heads_ui::HeadChanged,
|
||||
loading_assets::GameAssets,
|
||||
physics_layers::GameLayer,
|
||||
tb_entities::SpawnPoint,
|
||||
};
|
||||
@@ -68,6 +69,7 @@ fn spawn(
|
||||
asset_server: Res<AssetServer>,
|
||||
query: Query<&Transform, With<SpawnPoint>>,
|
||||
mut player_spawned: ResMut<PlayerSpawned>,
|
||||
assets: Res<GameAssets>,
|
||||
) {
|
||||
if player_spawned.spawned {
|
||||
return;
|
||||
@@ -114,9 +116,7 @@ fn spawn(
|
||||
Transform::from_translation(Vec3::new(0., -1.45, 0.))
|
||||
.with_rotation(Quat::from_rotation_y(std::f32::consts::PI))
|
||||
.with_scale(Vec3::splat(1.4)),
|
||||
SceneRoot(
|
||||
asset_server.load(GltfAssetLabel::Scene(0).from_asset(ALIEN_ASSET_PATH)),
|
||||
),
|
||||
SceneRoot(assets.mesh_alien.clone()),
|
||||
))
|
||||
.with_child((
|
||||
Name::from("head"),
|
||||
|
||||
Reference in New Issue
Block a user