use std::time::Duration;
use crate::particles::ParticleEffect;
use bevy::{
asset::Handle,
ecs::component::Component,
time::{Timer, TimerMode},
};
use crate::prelude::*;
#[derive(Component)]
pub struct Particle;
#[derive(Component)]
pub struct LifetimeTimer(pub Timer);
impl LifetimeTimer {
#[allow(dead_code, reason = "ghostly, what is this for?")]
pub fn new(lifetime: f32) -> LifetimeTimer {
LifetimeTimer(Timer::new(
Duration::from_secs_f32(lifetime),
TimerMode::Once,
))
}
}
#[derive(Component)]
pub struct SpawnDelayTimer(pub Timer);
impl SpawnDelayTimer {
pub fn new(delay: f32) -> SpawnDelayTimer {
SpawnDelayTimer(Timer::new(Duration::from_secs_f32(delay), TimerMode::Once))
}
}
#[derive(Component)]
pub struct CircleMesh(pub Handle<Mesh>, pub Handle<ColorMaterial>);
#[derive(Component)]
pub struct ParentEffect(pub ParticleEffect);