Skip to content

Commit

Permalink
Test_StructuralChange_Docs - clarify
Browse files Browse the repository at this point in the history
  • Loading branch information
friflo committed Feb 14, 2025
1 parent 969d671 commit 820c6af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Tests/ECS/Arch/Test_StructuralChange_Docs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void QueryException()
query.ForEachEntity((ref Position position, Entity entity) =>
{
// throws StructuralChangeException: within query loop. See: https://friflo.gitbook.io/friflo.engine.ecs/documentation/query#structuralchangeexception
entity.Add(new EntityName("test"));
entity.AddComponent(new EntityName("test"));
});

// Solution: Using a CommandBuffer
Expand All @@ -60,7 +60,7 @@ class QueryPositionSystem : QuerySystem<Position>
protected override void OnUpdate() {
Query.ForEachEntity((ref Position component1, Entity entity) => {
// throws StructuralChangeException: within query loop. See: https://friflo.gitbook.io/friflo.engine.ecs/documentation/query#structuralchangeexception
entity.Add(new EntityName("test"));
entity.AddComponent(new EntityName("test"));
});

// Solution: Using the system CommandBuffer
Expand Down

0 comments on commit 820c6af

Please sign in to comment.