MCPcopy Create free account
hub / github.com/Seldom-SE/seldom_map_nav / init

Function init

examples/state.rs:51–69  ·  view source on GitHub ↗
(mut commands: Commands, asset_server: Res<AssetServer>)

Source from the content-addressed store, hash-verified

49}
50
51fn 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
72fn move_player(

Callers

nothing calls this directly

Calls 1

init_innerFunction · 0.85

Tested by

no test coverage detected