mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 22:18:33 +00:00
Add From<EntityMut> for EntityRef (fixes #5459)
This commit is contained in:
parent
697d297b55
commit
927441d048
1 changed files with 6 additions and 0 deletions
|
@ -128,6 +128,12 @@ impl<'w> EntityRef<'w> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'w> From<EntityMut<'w>> for EntityRef<'w> {
|
||||||
|
fn from(entity_mut: EntityMut<'w>) -> EntityRef<'w> {
|
||||||
|
EntityRef::new(entity_mut.world, entity_mut.entity, entity_mut.location)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A mutable reference to a particular [`Entity`] and all of its components
|
/// A mutable reference to a particular [`Entity`] and all of its components
|
||||||
pub struct EntityMut<'w> {
|
pub struct EntityMut<'w> {
|
||||||
world: &'w mut World,
|
world: &'w mut World,
|
||||||
|
|
Loading…
Add table
Reference in a new issue