Skip to content

Ability to dynamically mark components as changed #1710

Closed

Description

@jakobhellermann

Before the reliable change pr one could insert ComponentFlags::MUTATED to mark a component as changed in a context where the type isn't known at compile time.

The equivalent function ComponentTicks::set_changed is now pub(crate):

pub(crate) fn set_changed(&mut self, change_tick: u32) {

The simple fix would be to make that function pub.

Alternatively we could expose a version of EntityMut::get_mut which passes in the component id:

#[inline]
pub fn get_mut_dynamic(&mut self, component_id: ComponentId) -> Option<MutDynamic<'w>> {
   // ...
}

Activity

  1. added
    A-ECSEntities, components, systems, and events
    C-FeatureA new feature, making something new possible
    C-UsabilityA targeted quality-of-life change that makes Bevy easier to use
    and removed
    C-FeatureA new feature, making something new possible
    on Mar 20, 2021
  2. added a commit that references this issue on Mar 22, 2021
    2dd2e5e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions