Skip to content

Commit 72238e3

Browse files
authored
fix some target comments (#20720)
# Objective - fix some `target` comments ## Solution - fix some `target` comments ## Testing - eyeballs
1 parent 057d1f5 commit 72238e3

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

crates/bevy_ecs/src/entity/clone_entities.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ impl<'a> BundleScratch<'a> {
426426
relationship_hook_insert_mode: RelationshipHookMode,
427427
) {
428428
// SAFETY:
429-
// - All `component_ids` are from the same world as `target` entity
429+
// - All `component_ids` are from the same world as `entity`
430430
// - All `component_data_ptrs` are valid types represented by `component_ids`
431431
unsafe {
432432
world.entity_mut(entity).insert_by_ids_internal(

crates/bevy_picking/src/events.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -141,23 +141,23 @@ pub struct Cancel {
141141
pub hit: HitData,
142142
}
143143

144-
/// Fires when a pointer crosses into the bounds of the `target` entity.
144+
/// Fires when a pointer crosses into the bounds of the [target entity](On::entity).
145145
#[derive(Clone, PartialEq, Debug, Reflect)]
146146
#[reflect(Clone, PartialEq)]
147147
pub struct Over {
148148
/// Information about the picking intersection.
149149
pub hit: HitData,
150150
}
151151

152-
/// Fires when a pointer crosses out of the bounds of the `target` entity.
152+
/// Fires when a pointer crosses out of the bounds of the [target entity](On::entity).
153153
#[derive(Clone, PartialEq, Debug, Reflect)]
154154
#[reflect(Clone, PartialEq)]
155155
pub struct Out {
156156
/// Information about the latest prior picking intersection.
157157
pub hit: HitData,
158158
}
159159

160-
/// Fires when a pointer button is pressed over the `target` entity.
160+
/// Fires when a pointer button is pressed over the [target entity](On::entity).
161161
#[derive(Clone, PartialEq, Debug, Reflect)]
162162
#[reflect(Clone, PartialEq)]
163163
pub struct Press {
@@ -167,7 +167,7 @@ pub struct Press {
167167
pub hit: HitData,
168168
}
169169

170-
/// Fires when a pointer button is released over the `target` entity.
170+
/// Fires when a pointer button is released over the [target entity](On::entity).
171171
#[derive(Clone, PartialEq, Debug, Reflect)]
172172
#[reflect(Clone, PartialEq)]
173173
pub struct Release {
@@ -178,7 +178,7 @@ pub struct Release {
178178
}
179179

180180
/// Fires when a pointer sends a pointer pressed event followed by a pointer released event, with the same
181-
/// `target` entity for both events.
181+
/// [target entity](On::entity) for both events.
182182
#[derive(Clone, PartialEq, Debug, Reflect)]
183183
#[reflect(Clone, PartialEq)]
184184
pub struct Click {
@@ -190,7 +190,7 @@ pub struct Click {
190190
pub duration: Duration,
191191
}
192192

193-
/// Fires while a pointer is moving over the `target` entity.
193+
/// Fires while a pointer is moving over the [target entity](On::entity).
194194
#[derive(Clone, PartialEq, Debug, Reflect)]
195195
#[reflect(Clone, PartialEq)]
196196
pub struct Move {
@@ -205,7 +205,7 @@ pub struct Move {
205205
pub delta: Vec2,
206206
}
207207

208-
/// Fires when the `target` entity receives a pointer pressed event followed by a pointer move event.
208+
/// Fires when the [target entity](On::entity) receives a pointer pressed event followed by a pointer move event.
209209
#[derive(Clone, PartialEq, Debug, Reflect)]
210210
#[reflect(Clone, PartialEq)]
211211
pub struct DragStart {
@@ -215,7 +215,7 @@ pub struct DragStart {
215215
pub hit: HitData,
216216
}
217217

218-
/// Fires while the `target` entity is being dragged.
218+
/// Fires while the [target entity](On::entity) is being dragged.
219219
#[derive(Clone, PartialEq, Debug, Reflect)]
220220
#[reflect(Clone, PartialEq)]
221221
pub struct Drag {
@@ -237,7 +237,7 @@ pub struct Drag {
237237
pub delta: Vec2,
238238
}
239239

240-
/// Fires when a pointer is dragging the `target` entity and a pointer released event is received.
240+
/// Fires when a pointer is dragging the [target entity](On::entity) and a pointer released event is received.
241241
#[derive(Clone, PartialEq, Debug, Reflect)]
242242
#[reflect(Clone, PartialEq)]
243243
pub struct DragEnd {
@@ -252,49 +252,49 @@ pub struct DragEnd {
252252
pub distance: Vec2,
253253
}
254254

255-
/// Fires when a pointer dragging the `dragged` entity enters the `target` entity.
255+
/// Fires when a pointer dragging the `dragged` entity enters the [target entity](On::entity).
256256
#[derive(Clone, PartialEq, Debug, Reflect)]
257257
#[reflect(Clone, PartialEq)]
258258
pub struct DragEnter {
259259
/// Pointer button pressed to enter drag.
260260
pub button: PointerButton,
261-
/// The entity that was being dragged when the pointer entered the `target` entity.
261+
/// The entity that was being dragged when the pointer entered the [target entity](On::entity).
262262
pub dragged: Entity,
263263
/// Information about the picking intersection.
264264
pub hit: HitData,
265265
}
266266

267-
/// Fires while the `dragged` entity is being dragged over the `target` entity.
267+
/// Fires while the `dragged` entity is being dragged over the [target entity](On::entity).
268268
#[derive(Clone, PartialEq, Debug, Reflect)]
269269
#[reflect(Clone, PartialEq)]
270270
pub struct DragOver {
271271
/// Pointer button pressed while dragging over.
272272
pub button: PointerButton,
273-
/// The entity that was being dragged when the pointer was over the `target` entity.
273+
/// The entity that was being dragged when the pointer was over the [target entity](On::entity).
274274
pub dragged: Entity,
275275
/// Information about the picking intersection.
276276
pub hit: HitData,
277277
}
278278

279-
/// Fires when a pointer dragging the `dragged` entity leaves the `target` entity.
279+
/// Fires when a pointer dragging the `dragged` entity leaves the [target entity](On::entity).
280280
#[derive(Clone, PartialEq, Debug, Reflect)]
281281
#[reflect(Clone, PartialEq)]
282282
pub struct DragLeave {
283283
/// Pointer button pressed while leaving drag.
284284
pub button: PointerButton,
285-
/// The entity that was being dragged when the pointer left the `target` entity.
285+
/// The entity that was being dragged when the pointer left the [target entity](On::entity).
286286
pub dragged: Entity,
287287
/// Information about the latest prior picking intersection.
288288
pub hit: HitData,
289289
}
290290

291-
/// Fires when a pointer drops the `dropped` entity onto the `target` entity.
291+
/// Fires when a pointer drops the `dropped` entity onto the [target entity](On::entity).
292292
#[derive(Clone, PartialEq, Debug, Reflect)]
293293
#[reflect(Clone, PartialEq)]
294294
pub struct DragDrop {
295295
/// Pointer button released to drop.
296296
pub button: PointerButton,
297-
/// The entity that was dropped onto the `target` entity.
297+
/// The entity that was dropped onto the [target entity](On::entity).
298298
pub dropped: Entity,
299299
/// Information about the picking intersection.
300300
pub hit: HitData,
@@ -322,7 +322,7 @@ pub struct DragEntry {
322322
pub latest_pos: Vec2,
323323
}
324324

325-
/// Fires while a pointer is scrolling over the `target` entity.
325+
/// Fires while a pointer is scrolling over the [target entity](On::entity).
326326
#[derive(Clone, PartialEq, Debug, Reflect)]
327327
#[reflect(Clone, PartialEq)]
328328
pub struct Scroll {

examples/ecs/observers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn on_remove_mine(event: On<Remove, Mine>, query: Query<&Mine>, mut index: ResMu
132132
}
133133

134134
fn explode_mine(event: On<Explode>, query: Query<&Mine>, mut commands: Commands) {
135-
// If a triggered event is targeting a specific entity you can access it with `.target()`
135+
// If a triggered event is targeting a specific entity you can access it with `.entity()`
136136
let id = event.entity();
137137
let Ok(mut entity) = commands.get_entity(id) else {
138138
return;

0 commit comments

Comments
 (0)