M client/src/plugins/game/card/mod.rs => client/src/plugins/game/card/mod.rs +0 -6
@@ 149,12 149,6 @@ fn on_spawn_card(
(
PickableBundle::default(),
RapierPickTarget::default(),
- OnPointer::<Over>::target_component_mut::<Transform>(|_over, transform| {
- transform.translation.y += 0.2;
- }),
- OnPointer::<Out>::target_component_mut::<Transform>(|_out, transform| {
- transform.translation.y -= 0.2;
- }),
OnPointer::<Click>::target_insert(ClickedCard),
)
);
M client/src/plugins/game/supply/mod.rs => client/src/plugins/game/supply/mod.rs +8 -1
@@ 7,6 7,7 @@
*/
use bevy::prelude::*;
+use bevy_mod_picking::prelude::*;
use bevy_rapier3d::prelude::*;
use crate::{plugins::GameActionCreateCallEvent, api::game::{Action, Command}, Global, game_status::PlayerState};
@@ 55,7 56,13 @@ fn spawn_supply_piles(
rigid_body: RigidBody::Fixed,
..Default::default()
})
- .insert(visual_card_kind::Supply(index));
+ .insert(visual_card_kind::Supply(index))
+ .insert(OnPointer::<Over>::target_component_mut::<Transform>(|_over, transform| {
+ transform.translation.y += 0.2;
+ }))
+ .insert(OnPointer::<Out>::target_component_mut::<Transform>(|_over, transform| {
+ transform.translation.y -= 0.2;
+ }));
}
psp_ev_w.send(PositionSupplyPilesEvent);