Fix QuerySingle -> Single missed in example (#15667)

Missed in https://github.com/bevyengine/bevy/pull/15507
This commit is contained in:
mgi388 2024-10-06 09:24:03 +11:00 committed by GitHub
parent 42e0771633
commit 7c03ca2562
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -134,9 +134,9 @@ fn move_targets(mut enemies: Populated<(&mut Transform, &mut Enemy)>, time: Res<
/// If there is one, player will track it. /// If there is one, player will track it.
/// If there are too many enemies, the player will cease all action (the system will not run). /// If there are too many enemies, the player will cease all action (the system will not run).
fn move_pointer( fn move_pointer(
// `QuerySingle` ensures the system runs ONLY when exactly one matching entity exists. // `Single` ensures the system runs ONLY when exactly one matching entity exists.
mut player: Single<(&mut Transform, &Player)>, mut player: Single<(&mut Transform, &Player)>,
// `Option<QuerySingle>` ensures that the system runs ONLY when zero or one matching entity exists. // `Option<Single>` ensures that the system runs ONLY when zero or one matching entity exists.
enemy: Option<Single<&Transform, (With<Enemy>, Without<Player>)>>, enemy: Option<Single<&Transform, (With<Enemy>, Without<Player>)>>,
time: Res<Time>, time: Res<Time>,
) { ) {