mirror of
https://github.com/bevyengine/bevy
synced 2025-01-04 17:28:56 +00:00
5b899b48f5
# Objective - Better `SystemId` <-> `Entity` conversion. ## Solution - Provide a method `SystemId::from_entity` to create a `SystemId<I, O>` form an `Entity`. When users want to deal with the entities manually they need a way to convert the `Entity` back to a `SystemId` to actually run the system with `Commands` or `World`. - Provide a method `SystemId::entity` that returns an `Entity` from `SystemId`. The current `From` impl is not very discoverable as it does not appear on the `SystemId` doc page. - Remove old `From` impl. ## Migration Guide ```rust let system_id = world.register_system(my_sys); // old let entity = Entity::from(system_id); // new let entity = system_id.entity(); ``` --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> |
||
---|---|---|
.. | ||
commands | ||
adapter_system.rs | ||
combinator.rs | ||
exclusive_function_system.rs | ||
exclusive_system_param.rs | ||
function_system.rs | ||
mod.rs | ||
query.rs | ||
system.rs | ||
system_name.rs | ||
system_param.rs | ||
system_registry.rs |