26 lines
605 B
Rust
26 lines
605 B
Rust
use crate::entity::EntityHandle;
|
|
use crate::systems::camera::{start_camera_following, stop_camera_following};
|
|
use crate::utility::input::InputState;
|
|
use crate::world::World;
|
|
|
|
pub fn noclip_toggle_system(
|
|
world: &mut World,
|
|
input_state: &InputState,
|
|
camera_entity: EntityHandle,
|
|
noclip_mode: &mut bool,
|
|
)
|
|
{
|
|
if input_state.noclip_just_pressed
|
|
{
|
|
*noclip_mode = !*noclip_mode;
|
|
if *noclip_mode
|
|
{
|
|
stop_camera_following(world, camera_entity);
|
|
}
|
|
else
|
|
{
|
|
start_camera_following(world, camera_entity);
|
|
}
|
|
}
|
|
}
|