generated from tipragot/rust
Add a camera system #69
|
@ -45,7 +45,7 @@ pub struct CameraPlugin;
|
||||||
impl Plugin for CameraPlugin {
|
impl Plugin for CameraPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
app.add_systems(Startup, init_camera)
|
app.add_systems(Startup, init_camera)
|
||||||
.add_systems(Startup, init_resources)
|
.add_systems(Startup, init_resources_for_camera)
|
||||||
.add_systems(Update, movement_system.run_if(in_state(CurrentScene::Game)))
|
.add_systems(Update, movement_system.run_if(in_state(CurrentScene::Game)))
|
||||||
.add_systems(Update, scale_system.run_if(in_state(CurrentScene::Game)));
|
.add_systems(Update, scale_system.run_if(in_state(CurrentScene::Game)));
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ fn init_camera(mut commands: Commands) {
|
||||||
/// - [CameraSpeedScale]: The speed of camera scaling.
|
/// - [CameraSpeedScale]: The speed of camera scaling.
|
||||||
/// - [MinimumScale]: The minimum scale of the camera.
|
/// - [MinimumScale]: The minimum scale of the camera.
|
||||||
/// - [MaximumScale]: The maximum scale of the camera.
|
/// - [MaximumScale]: The maximum scale of the camera.
|
||||||
fn init_resources(mut commands: Commands) {
|
fn init_resources_for_camera(mut commands: Commands) {
|
||||||
commands.insert_resource(KeysMovementSettings {
|
commands.insert_resource(KeysMovementSettings {
|
||||||
up: KeyCode::Z,
|
up: KeyCode::Z,
|
||||||
down: KeyCode::S,
|
down: KeyCode::S,
|
||||||
|
|
Loading…
Reference in a new issue