Add conversion methods.

This commit is contained in:
Nolan Darilek 2022-02-12 08:47:59 -06:00
parent 7087e47e6a
commit 701cac5568

View File

@ -40,6 +40,12 @@ pub struct Portal;
#[reflect(Component)]
pub struct SpawnColliderPerTile(pub bool);
impl From<bool> for SpawnColliderPerTile {
fn from(v: bool) -> Self {
Self(v)
}
}
#[derive(Component, Clone, Debug, Deref, DerefMut, Reflect)]
#[reflect(Component)]
pub struct SpawnColliders(pub bool);
@ -50,6 +56,12 @@ impl Default for SpawnColliders {
}
}
impl From<bool> for SpawnColliders {
fn from(v: bool) -> Self {
Self(v)
}
}
#[derive(Component, Clone, Debug, Deref, DerefMut, Reflect)]
#[reflect(Component)]
pub struct SpawnPortals(pub bool);