mirror of
https://github.com/bevyengine/bevy
synced 2024-12-22 02:53:07 +00:00
5472ea4a14
# Objective Several of our built-in `Command` types are too public: - `GetOrSpawn` is public, even though it only makes sense to call it from within `Commands::get_or_spawn`. - `Remove` and `RemoveResource` contain public `PhantomData` marker fields. ## Solution Remove `GetOrSpawn` and use an anonymous command. Make the marker fields private. --- ## Migration Guide The `Command` types `Remove` and `RemoveResource` may no longer be constructed manually. ```rust // Before: commands.add(Remove::<T> { entity: id, phantom: PhantomData, }); // After: commands.add(Remove::<T>::new(id)); // Before: commands.add(RemoveResource::<T> { phantom: PhantomData }); // After: commands.add(RemoveResource::<T>::new()); ``` The command type `GetOrSpawn` has been removed. It was not possible to use this type outside of `bevy_ecs`. |
||
---|---|---|
.. | ||
commands | ||
combinator.rs | ||
exclusive_function_system.rs | ||
exclusive_system_param.rs | ||
function_system.rs | ||
mod.rs | ||
query.rs | ||
system.rs | ||
system_param.rs |