[−][src]Struct bevy::prelude::Timer
Tracks elapsed time. Enters the finished state once duration
is reached.
Non repeating timers will stop tracking and stay in the finished state until reset.
Repeating timers will only be in the finished state on each tick duration
is reached or exceeded, and can still be reset at any given point.
Fields
elapsed: f32
duration: f32
finished: bool
just_finished: bool
Will only be true on the tick duration
is reached or exceeded.
repeating: bool
Implementations
impl Timer
[src]
pub fn new(duration: Duration, repeating: bool) -> Timer
[src]
pub fn from_seconds(seconds: f32, repeating: bool) -> Timer
[src]
pub fn tick(&mut self, delta: f32)
[src]
Advances the timer by delta
seconds.
pub fn reset(&mut self)
[src]
Trait Implementations
impl Clone for Timer
[src]
impl Debug for Timer
[src]
impl Default for Timer
[src]
impl DeserializeProperty for Timer
[src]
pub fn deserialize(
deserializer: &mut dyn Deserializer<'_>,
property_type_registry: &PropertyTypeRegistry
) -> Result<Box<dyn Property + 'static>, Error>
[src]
deserializer: &mut dyn Deserializer<'_>,
property_type_registry: &PropertyTypeRegistry
) -> Result<Box<dyn Property + 'static>, Error>
impl Properties for Timer
[src]
pub fn prop(&self, name: &str) -> Option<&(dyn Property + 'static)>
[src]
pub fn prop_mut(&mut self, name: &str) -> Option<&mut (dyn Property + 'static)>
[src]
pub fn prop_with_index(&self, index: usize) -> Option<&(dyn Property + 'static)>
[src]
pub fn prop_with_index_mut(
&mut self,
index: usize
) -> Option<&mut (dyn Property + 'static)>
[src]
&mut self,
index: usize
) -> Option<&mut (dyn Property + 'static)>
pub fn prop_name(&self, index: usize) -> Option<&str>
[src]
pub fn prop_len(&self) -> usize
[src]
pub fn iter_props(&self) -> PropertyIter<'_>ⓘNotable traits for PropertyIter<'a>
impl<'a> Iterator for PropertyIter<'a> type Item = &'a (dyn Property + 'static);
[src]
Notable traits for PropertyIter<'a>
impl<'a> Iterator for PropertyIter<'a> type Item = &'a (dyn Property + 'static);
fn set_prop(&mut self, name: &str, value: &(dyn Property + 'static))
[src]
fn to_dynamic(&self) -> DynamicProperties
[src]
impl Property for Timer
[src]
pub fn type_name(&self) -> &str
[src]
pub fn any(&self) -> &(dyn Any + 'static)
[src]
pub fn any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
pub fn clone_prop(&self) -> Box<dyn Property + 'static>
[src]
pub fn set(&mut self, value: &(dyn Property + 'static))
[src]
pub fn apply(&mut self, value: &(dyn Property + 'static))
[src]
pub fn as_properties(&self) -> Option<&(dyn Properties + 'static)>
[src]
pub fn serializable(
&'a self,
registry: &'a PropertyTypeRegistry
) -> Serializable<'a>
[src]
&'a self,
registry: &'a PropertyTypeRegistry
) -> Serializable<'a>
pub fn property_type(&self) -> PropertyType
[src]
Auto Trait Implementations
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnwindSafe for Timer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,
impl<T> Component for T where
T: 'static + Send + Sync,
T: 'static + Send + Sync,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T> FromResources for T where
T: Default,
[src]
T: Default,
pub fn from_resources(_resources: &Resources) -> T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<P> PropertiesVal for P where
P: Properties,
[src]
P: Properties,
pub fn prop_val<T>(&self, name: &str) -> Option<&T> where
T: 'static,
[src]
T: 'static,
pub fn set_prop_val<T>(&mut self, name: &str, value: T) where
T: 'static,
[src]
T: 'static,
impl<T> Resource for T where
T: 'static + Send + Sync,
[src]
T: 'static + Send + Sync,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,