Skip to content
New issue

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

Res<Assets<T>>.is_changed() is true every frame, even when not changed #2275

Closed
TheLeonsver1 opened this issue May 29, 2021 · 0 comments
Closed
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior

Comments

@TheLeonsver1
Copy link

Bevy version

0.5

Operating system & version

Windows 10

What you did

checked if my assets changed

What you expected to happen

for it to only be triggered once after the assets were changed.

What actually happened

Res<Assets<T>>.is_changed() triggered every frame without even changing assets

@TheLeonsver1 TheLeonsver1 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 29, 2021
@TheLeonsver1 TheLeonsver1 changed the title Res<Assets<T>>.is_selected() is true every frame, even when not changed Res<Assets<T>>.is_changed() is true every frame, even when not changed May 29, 2021
@alice-i-cecile alice-i-cecile added A-Assets Load files from disk to use for things like images, models, and sounds and removed S-Needs-Triage This issue needs to be labelled labels May 29, 2021
@bors bors bot closed this as completed in 0b67084 Jun 2, 2021
ostwilkens pushed a commit to ostwilkens/bevy that referenced this issue Jul 27, 2021
## Objective
- Fixes: bevyengine#2275 
- `Assets` were being flagged as 'changed' each frame regardless of if the assets were actually being updated. 

## Solution
- Only have `Assets` change detection be triggered when the collection is actually modified. 
- This includes utilizing `ResMut` further down the stack instead of a `&mut Assets` directly.
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 C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants