add prelude

This commit is contained in:
Schmarni
2024-02-20 13:36:05 +01:00
parent df71c7931d
commit 4779993ae2
3 changed files with 46 additions and 4 deletions

15
src/prelude.rs Normal file
View File

@@ -0,0 +1,15 @@
use bevy::ecs::schedule::{IntoSystemConfigs, SystemConfigs};
use crate::xr_init::xr_only;
pub use crate::xr_input::{QuatConv, Vec2Conv, Vec3Conv};
pub use crate::xr_init::schedules::XrSetup;
pub trait XrSystems<Marker> {
fn xr_only(self) -> SystemConfigs;
}
impl<T: IntoSystemConfigs<M>, M> XrSystems<M> for T {
fn xr_only(self) -> SystemConfigs {
self.into_configs().run_if(xr_only())
}
}