Skip to content

Add a system's entity to run conditions, when we have them #19716

Open
@Freyja-moth

Description

@Freyja-moth

What problem does this solve or what need does it fill?

This is a bit early, but once #16618 lands, information about a system will be found by using it's entity, something that might be useful for run conditions to have.

What solution would you like?

#[derive(Component)]
pub struct RunComponent;

fn run_if_has_component(system: Entity, run_components: Query<(), With<RunComponent>>) -> bool {
    run_components.contains(system)
}

Obviously this example isn't representative of what people would be doing, it's mostly just the simplest example I could think of.

What alternative(s) have you considered?

Use the current method.

Additional context

This may also be able to help with #19712

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleS-BlockedThis cannot move forward until something else changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions