Add PartialEq
and Hash
reflections for AnimationNodeIndex
(#18718)
# Objective Fixes #18701 ## Solution Add reflection of `PartialEq` and `Hash` to `AnimationNodeIndex` ## Testing Added a new `#[test]` with the minimal reproduction posted on #18701.
This commit is contained in:
parent
06f9e5eca5
commit
78d5c50b50
@ -1530,6 +1530,8 @@ impl<'a> Iterator for TriggeredEventsIter<'a> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use bevy_reflect::{DynamicMap, Map};
|
||||
|
||||
use super::*;
|
||||
|
||||
#[derive(Event, Reflect, Clone)]
|
||||
@ -1661,4 +1663,13 @@ mod tests {
|
||||
active_animation.update(clip.duration, clip.duration); // 0.3 : 0.0
|
||||
assert_triggered_events_with(&active_animation, &clip, [0.3, 0.2]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_animation_node_index_as_key_of_dynamic_map() {
|
||||
let mut map = DynamicMap::default();
|
||||
map.insert_boxed(
|
||||
Box::new(AnimationNodeIndex::new(0)),
|
||||
Box::new(ActiveAnimation::default()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ use crate::{impl_reflect_opaque, prelude::ReflectDefault, ReflectDeserialize, Re
|
||||
impl_reflect_opaque!(::petgraph::graph::NodeIndex(
|
||||
Clone,
|
||||
Default,
|
||||
PartialEq,
|
||||
Hash,
|
||||
Serialize,
|
||||
Deserialize
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user