Implement component lifecycle (Added/Removed) #45

Open
opened 2025-12-17 02:48:52 +00:00 by siennathesane · 0 comments
siennathesane commented 2025-12-17 02:48:52 +00:00 (Migrated from github.com)

Description

Handle entity spawn and despawn events for audio components. Create/cleanup Firewheel nodes when entities are added/removed.

Acceptance Criteria

Scenario: Component lifecycle is managed
  Given the ECS audio systems
  When an entity with AudioSource is spawned
  Then Firewheel nodes should be created
  And when the entity is despawned
  Then Firewheel nodes should be cleaned up
  And no memory leaks should occur

Technical Notes

  • Use Added<AudioSource> query to detect new entities
  • Create Firewheel nodes (sampler → processor → bus)
  • Use RemovedComponents<AudioSource> to detect despawns
  • Cleanup Firewheel nodes properly
  • Test for memory leaks
## Description Handle entity spawn and despawn events for audio components. Create/cleanup Firewheel nodes when entities are added/removed. ## Acceptance Criteria ```gherkin Scenario: Component lifecycle is managed Given the ECS audio systems When an entity with AudioSource is spawned Then Firewheel nodes should be created And when the entity is despawned Then Firewheel nodes should be cleaned up And no memory leaks should occur ``` ## Technical Notes - Use `Added<AudioSource>` query to detect new entities - Create Firewheel nodes (sampler → processor → bus) - Use `RemovedComponents<AudioSource>` to detect despawns - Cleanup Firewheel nodes properly - Test for memory leaks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: studio/marathon#45