ecs: add ability to set the current entity in world builders
This commit is contained in:
parent
4a0f8b8869
commit
dfde160741
@ -34,6 +34,11 @@ impl<'a> WorldBuilder<'a> {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_entity(&mut self, entity: Entity) -> &mut Self {
|
||||||
|
self.current_entity = Some(entity);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// note: this is slow and does a full entity copy
|
/// note: this is slow and does a full entity copy
|
||||||
pub fn with<T>(&mut self, component: T) -> &mut Self
|
pub fn with<T>(&mut self, component: T) -> &mut Self
|
||||||
where
|
where
|
||||||
@ -114,6 +119,11 @@ impl<'a> CommandBufferBuilder<'a> {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_entity(&mut self, entity: Entity) -> &mut Self {
|
||||||
|
self.current_entity = Some(entity);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
// note: this is slow and does a full entity copy
|
// note: this is slow and does a full entity copy
|
||||||
pub fn with<T>(&mut self, component: T) -> &mut Self
|
pub fn with<T>(&mut self, component: T) -> &mut Self
|
||||||
where
|
where
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user