(mut commands: Commands, asset_server: Res<AssetServer>)
| 49 | } |
| 50 | |
| 51 | fn init(mut commands: Commands, asset_server: Res<AssetServer>) { |
| 52 | let player_bundle = init_inner(&mut commands, &asset_server); |
| 53 | |
| 54 | commands.spawn(( |
| 55 | player_bundle, |
| 56 | StateMachine::default() |
| 57 | // When the player clicks, go there. Using previously defined `Click` trigger here |
| 58 | .trans_builder(click, |trans: Trans<AnyState, _>| GoToSelection { |
| 59 | speed: 200., |
| 60 | target: trans.out, |
| 61 | }) |
| 62 | // `DoneTrigger` triggers when the `Done` component is added to the entity. When they're |
| 63 | // done going to the selection, idle. |
| 64 | .trans::<GoToSelection, _>(done(None), Idle) |
| 65 | .set_trans_logging(true), |
| 66 | Player, |
| 67 | Idle, |
| 68 | )); |
| 69 | } |
| 70 | |
| 71 | // Navigate the player to wherever you click |
| 72 | fn move_player( |
nothing calls this directly
no test coverage detected