Skip to content

Conversation

Glory2Antares
Copy link
Contributor

@Glory2Antares Glory2Antares commented Sep 2, 2025

Objective

  • Although SceneRoot and DynamicSceneRoot are simply wrappers around a Handle<Scene>, neither implement AsAssetId. Hence they do not work with the AssetChanged<A> filter.

Solution

  • Implement AsAssetId for SceneRoot and DynamicSceneRoot. Asset = Scene for both.

Showcase

Now users can filter for SceneRoot whose underlying Scene asset has changed.

fn query_scene_roots_with_changed_scenes(query: Query<&SceneRoot, AssetChanged<SceneRoot>>) {
    for scene_root in &query {
        println!("some logic");
    }
}

@Glory2Antares Glory2Antares marked this pull request as ready for review September 2, 2025 02:03
@Glory2Antares Glory2Antares changed the title Draft: Impl AsAssetId for SceneRoot and DynamicSceneRoot Impl AsAssetId for SceneRoot and DynamicSceneRoot Sep 2, 2025
@tychedelia tychedelia added C-Feature A new feature, making something new possible A-Assets Load files from disk to use for things like images, models, and sounds A-Scenes Serialized ECS data stored on the disk S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds A-Scenes Serialized ECS data stored on the disk C-Feature A new feature, making something new possible S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants