Compare commits

...

2 Commits

Author SHA1 Message Date
andriyDev
c9229c6884
Merge 930033354b into 06403153c3 2024-05-26 02:27:26 +00:00
andriyDev
930033354b Switch to using the SceneInstance component to determine the nearest Gltf. 2024-05-25 19:26:55 -07:00
2 changed files with 3 additions and 7 deletions

View File

@ -14,10 +14,7 @@ license = "MIT OR Apache-2.0"
workspace = true
[dependencies]
bevy = { version = "0.13", default-features = false, features = [
"bevy_asset",
"bevy_scene",
] }
bevy = { version = "0.13", default-features = false, features = ["bevy_scene"] }
bevy_gltf_components = { version = "0.5", path = "../bevy_gltf_components" }
[dev-dependencies]

View File

@ -1,6 +1,5 @@
use bevy::{
app::{App, Plugin},
asset::Handle,
ecs::{
component::Component,
entity::Entity,
@ -13,7 +12,7 @@ use bevy::{
log::warn,
prelude::Update,
reflect::{Reflect, TypePath},
scene::Scene,
scene::SceneInstance,
utils::HashMap,
};
use bevy_gltf_components::GltfComponentsSet;
@ -157,7 +156,7 @@ impl<T: Component + FromGltfRef> Default for GltfRefPlugin<T> {
/// SystemParam to find the Gltf that an entity belongs to.
#[derive(SystemParam)]
pub struct GltfForEntity<'w, 's> {
gltfs: Query<'w, 's, (), With<Handle<Scene>>>,
gltfs: Query<'w, 's, (), With<SceneInstance>>,
hierarchy: Query<'w, 's, &'static Parent>,
}