Replies: 1 comment 1 reply
-
You should be able to use something like:
Or you can do a nested match:
And I think on recent Rusts you can do:
For the printing, you are using bevy/crates/bevy_ecs/src/entity/mod.rs Lines 150 to 154 in dbd856d Looks like it includes the generation so if you just want the id you should use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Working with bevy_mod_picking crate.
In the callback event when you pick a mesh the example code has:
I need to access the Entity in all cases.
Clicked(e) is already an entity so I can modify it to use an Entity method:
The others are of type:
and
My question is two fold:
When I run the program and select a mesh "selection JustSelected(1v0)" is printed.
1 in this case is the Entity id but I don't understand the construction 1v0. What is v in this case? Is this some sort way of printing a tuple?
Most importantly how do I modify the event handler to use the e argument of Selection(e)? As with Clicked(e) I would like to print the Entity id number of the selected mesh. Eg:
`PickingEvent::Selection(e) => info!("selection {}", e/magic grammar here/.id()),
Thanks
`
Beta Was this translation helpful? Give feedback.
All reactions