set_if_neq
https://github.com/zkat/big-brain/blob/d9181eec41e3744b5eeb38acf72128bb40f03292/src/scorers.rs#L132-L141
This is useful to ensure change detection is only triggered when the underlying value changes, instead of every time it is mutably accessed.
1. `query: Query<(Ref<FixedScore>, &mut Score, &ScorerSpan)` + is_changed()
2. score.set_if_neq()
I'm a beginner. If the value needs to be set every frame, please ignore this issue.
关闭于 2025-04-24 1 条评论