document using ObserverState
as filter for Observer
Entity
s (#14669)
# Objective ~~Enables writing queries like `Query<Entity, With<ObserverMarker>>` to filter `Entity`s that are, or are not (with `Without`), `Observer`s.~~ ~~`Observer` version of [similar PR](https://github.com/bevyengine/bevy/pull/14584) for `SystemId`s.~~ just adding a line to the docs :) ## Solution ~~Simple unit struct `ObserverMarker` added in `Observer`'s `.on_add` component hook.~~ ## Testing No tests, but happy to write some with direction.
This commit is contained in:
parent
2c4ef37b76
commit
c3111bebb8
@ -257,7 +257,8 @@ pub type ObserverRunner = fn(DeferredWorld, ObserverTrigger, PtrMut, propagate:
|
||||
/// You can call [`Observer::watch_entity`] more than once, which allows you to watch multiple entities with the same [`Observer`].
|
||||
///
|
||||
/// When first added, [`Observer`] will also create an [`ObserverState`] component, which registers the observer with the [`World`] and
|
||||
/// serves as the "source of truth" of the observer.
|
||||
/// serves as the "source of truth" of the observer. [`ObserverState`] can be used to filter for [`Observer`] [`Entity`]s, e.g.
|
||||
/// [`With<ObserverState>`].
|
||||
///
|
||||
/// [`SystemParam`]: crate::system::SystemParam
|
||||
pub struct Observer<T: 'static, B: Bundle> {
|
||||
|
Loading…
Reference in New Issue
Block a user