Skip to content

Commit

Permalink
Switch to using the SceneInstance component to determine the nearest …
Browse files Browse the repository at this point in the history
…Gltf.
  • Loading branch information
andriyDev committed May 26, 2024
1 parent d7af899 commit 9300333
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 1 addition & 4 deletions crates/bevy_gltf_component_refs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 2 additions & 3 deletions crates/bevy_gltf_component_refs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use bevy::{
app::{App, Plugin},
asset::Handle,
ecs::{
component::Component,
entity::Entity,
Expand All @@ -13,7 +12,7 @@ use bevy::{
log::warn,
prelude::Update,
reflect::{Reflect, TypePath},
scene::Scene,
scene::SceneInstance,
utils::HashMap,
};
use bevy_gltf_components::GltfComponentsSet;
Expand Down Expand Up @@ -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>,
}

Expand Down

0 comments on commit 9300333

Please sign in to comment.