A system that only executes when predicate returns true
Example
// Only run movement when game is not paused constgameState = { isPaused:false }; constpausableMovement = conditionalSystem( () => !gameState.isPaused, movementSystem );
Example
// Run AI only when there are enemies constaiSystem = conditionalSystem( () =>countEntities(world, 'enemy') > 0, enemyAI );
Creates a conditional system that only runs when a predicate is true.
Enables dynamic system control based on game state. More flexible than manual enable/disable as the condition is evaluated every frame.