Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for component disabling for prefabs #346

Open
jtferson opened this issue Mar 17, 2021 · 0 comments
Open

Allow for component disabling for prefabs #346

jtferson opened this issue Mar 17, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@jtferson
Copy link
Sponsor Contributor

Describe the problem you are trying to solve.
Currently it's possible to disable components for regular entities. It might be useful to expand that functionality to define which components of the prefab instances will be disabled by default.

Describe the solution you'd like
Instances inherit the disabling status of components from the prefab:

// Velocity will be disabled for every instance by default
auto prefab = ecs.prefab()
	.add<Movable>()
	.add_owned<Velocity>()
	.disable<Velocity>();

// Here an instance is getting the Velocity component as disabled
auto instance = ecs.entity().add_instanceof(prefab);

// Example: a system matches only entities with enabled Velocity
ecs.system<>().signature("Velocity, Movable").iter([](flecs::iter& it)
{
       test_int(it.count(), 0);
});
@jtferson jtferson added the enhancement New feature or request label Mar 17, 2021
@SanderMertens SanderMertens added this to To do in v3 via automation Mar 17, 2021
@SanderMertens SanderMertens removed this from To do in v3 Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants