We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the problem you are trying to solve. Currently, if we define switchable tags for prefabs, they don't match with the instance entities.
Describe the solution you'd like
struct IdleState { }; struct FlyingState { }; struct FightingState { }; auto ShipBehaviourType = ecs.type("ShipBehaviour"); ShipBehaviourType.add(ecs.component<IdleState>()); ShipBehaviourType.add(ecs.component<FlyingState>()); ShipBehaviourType.add(ecs.component<FightingState>()); auto ShipPrefab = ecs.prefab() .add<Weapon>() .add_switch(ShipBehaviourType) .add_owned(ShipBehaviourType) //<-- Set Switch as owned .add_case<IdleState>() .add_owned<IdleState>(); //<-- Set Case as owned ecs.entity("Rocinante") .add_instanceof(ShipPrefab) .add_case<FightingState>(); //<--- Override the default case ecs.query<>("SWITCH | FightingState, CASE | FightingState").iter([ ](flecs::iter& It) { //Matches Rocinante with FightingState });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the problem you are trying to solve.
Currently, if we define switchable tags for prefabs, they don't match with the instance entities.
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: