addressed comments
This commit is contained in:
parent
e3ccd1b8e5
commit
57581349b9
@ -70,6 +70,7 @@
|
||||
use crate::{
|
||||
component::{ComponentId, Components, StorageType},
|
||||
query::FilteredAccess,
|
||||
resource::IsResource,
|
||||
world::{FromWorld, World},
|
||||
};
|
||||
use bevy_ecs_macros::{Component, Resource};
|
||||
@ -143,6 +144,8 @@ impl FromWorld for DefaultQueryFilters {
|
||||
let mut filters = DefaultQueryFilters::empty();
|
||||
let disabled_component_id = world.register_component::<Disabled>();
|
||||
filters.register_disabling_component(disabled_component_id);
|
||||
let is_resource_component_id = world.register_component::<IsResource>();
|
||||
filters.register_disabling_component(is_resource_component_id);
|
||||
filters
|
||||
}
|
||||
}
|
||||
|
@ -2174,10 +2174,7 @@ mod tests {
|
||||
world.spawn((B(0), C(0)));
|
||||
world.spawn(C(0));
|
||||
|
||||
let mut df = DefaultQueryFilters::empty();
|
||||
df.register_disabling_component(world.register_component::<C>());
|
||||
world.insert_resource(df);
|
||||
world.register_disabling_component::<IsResource>();
|
||||
world.register_disabling_component::<C>();
|
||||
|
||||
// Without<C> only matches the first entity
|
||||
let mut query = QueryState::<()>::new(&mut world);
|
||||
|
@ -22,7 +22,7 @@ use crate::{
|
||||
event::BufferedEvent,
|
||||
lifecycle::{ComponentHooks, ADD, DESPAWN, INSERT, REMOVE, REPLACE},
|
||||
prelude::{Add, Despawn, Insert, Remove, Replace},
|
||||
resource::{IsResource, ResourceEntity, TypeErasedResource},
|
||||
resource::{ResourceEntity, TypeErasedResource},
|
||||
};
|
||||
pub use bevy_ecs_macros::FromWorld;
|
||||
use bevy_utils::prelude::DebugName;
|
||||
@ -170,7 +170,6 @@ impl World {
|
||||
|
||||
// This sets up `Disabled` as a disabling component, via the FromWorld impl
|
||||
self.init_resource::<DefaultQueryFilters>();
|
||||
self.register_disabling_component::<IsResource>();
|
||||
}
|
||||
/// Creates a new empty [`World`].
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user