mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
# Objective Fix #10731. ## Solution Rename `App::add_state<T>(&mut self)` to `init_state`, and add `App::insert_state<T>(&mut self, state: T)`. I decided on these names because they are more similar to `init_resource` and `insert_resource`. I also removed the `States` trait's requirement for `Default`. Instead, `init_state` requires `FromWorld`. --- ## Changelog - Renamed `App::add_state` to `init_state`. - Added `App::insert_state`. - Removed the `States` trait's requirement for `Default`. ## Migration Guide - Renamed `App::add_state` to `init_state`. |
||
---|---|---|
.. | ||
apply_deferred.rs | ||
component_change_detection.rs | ||
custom_query_param.rs | ||
ecs_guide.rs | ||
event.rs | ||
fixed_timestep.rs | ||
generic_system.rs | ||
hierarchy.rs | ||
iter_combinations.rs | ||
nondeterministic_system_order.rs | ||
one_shot_systems.rs | ||
parallel_query.rs | ||
removal_detection.rs | ||
run_conditions.rs | ||
startup_system.rs | ||
state.rs | ||
system_closure.rs | ||
system_param.rs | ||
system_piping.rs |