fixed panic when selecting dropdown item
@@ -509,6 +509,7 @@ impl SideBar {
UiMessageData::DropdownList(DropdownListMessage::SelectionChanged(
Some(index),
)) => {
+ if message.destination() == self.physics_binding {
let id = match node.physics_binding() {
PhysicsBinding::NodeWithBody => 0,
PhysicsBinding::BodyWithNode => 1,
@@ -521,12 +522,15 @@ impl SideBar {
_ => unreachable!(),
};
self.sender
- .send(Message::DoSceneCommand(SceneCommand::SetPhysicsBinding(
+ .send(Message::DoSceneCommand(
+ SceneCommand::SetPhysicsBinding(
SetPhysicsBindingCommand::new(node_handle, value),
- )))
+ ),
+ ))
.unwrap();
}
}
+ }
_ => (),
}
