#![allow(clippy::all)]
#![allow(unused, deprecated, dead_code)]
extern crate std;
use bevy_app::{App, Plugin};
use bevy_ecs::prelude::*;
use bevy_mod_scripting_bindings::{
ReflectReference,
function::{
from::{M, R, V},
namespace::NamespaceBuilder,
},
};
use bevy_mod_scripting_derive::script_bindings;
pub struct BevyTimeScriptingPlugin;
pub(crate) fn register_fixed_functions(world: &mut World) {
bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::<::bevy_time::Fixed>::new(
world,
)
.register_documented(
"clone",
|_self: R<::bevy_time::Fixed>| {
let output: V<::bevy_time::Fixed> = {
{
let output: V<::bevy_time::Fixed> =
<::bevy_time::Fixed as ::core::clone::Clone>::clone(&_self).into();
output
}
};
output
},
"",
&["_self"],
);
let registry = world.get_resource_or_init::<AppTypeRegistry>();
let mut registry = registry.write();
registry
.register_type_data::<::bevy_time::Fixed, bevy_mod_scripting_bindings::MarkAsGenerated>();
}
pub(crate) fn register_real_functions(world: &mut World) {
bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::<::bevy_time::Real>::new(
world,
)
.register_documented(
"clone",
|_self: R<::bevy_time::Real>| {
let output: V<::bevy_time::Real> = {
{
let output: V<::bevy_time::Real> =
<::bevy_time::Real as ::core::clone::Clone>::clone(&_self).into();
output
}
};
output
},
"",
&["_self"],
);
let registry = world.get_resource_or_init::<AppTypeRegistry>();
let mut registry = registry.write();
registry
.register_type_data::<::bevy_time::Real, bevy_mod_scripting_bindings::MarkAsGenerated>();
}
pub(crate) fn register_timer_functions(world: &mut World) {
bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::<
::bevy_time::Timer,
>::new(world)
.register_documented(
"almost_finish",
|mut _self: M<::bevy_time::Timer>| {
let output: () = {
{
let output: () = ::bevy_time::Timer::almost_finish(&mut _self)
.into();
output
}
};
output
},
" Almost finishes the timer leaving 1 ns of remaining time.\n This can be useful when needing an immediate action without having\n to wait for the set duration of the timer in the first tick.\n If the timer is already finished, this does nothing.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(1.5, TimerMode::Once);\n timer.almost_finish();\n assert!(!timer.is_finished());\n assert_eq!(timer.remaining(), Duration::from_nanos(1));\n ```",
&["_self"],
)
.register_documented(
"clone",
|_self: R<::bevy_time::Timer>| {
let output: V<::bevy_time::Timer> = {
{
let output: V<::bevy_time::Timer> = <::bevy_time::Timer as ::core::clone::Clone>::clone(
&_self,
)
.into();
output
}
};
output
},
"",
&["_self"],
)
.register_documented(
"duration",
|_self: R<::bevy_time::Timer>| {
let output: V<::core::time::Duration> = {
{
let output: V<::core::time::Duration> = ::bevy_time::Timer::duration(
&_self,
)
.into();
output
}
};
output
},
" Returns the duration of the timer.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let timer = Timer::new(Duration::from_secs(1), TimerMode::Once);\n assert_eq!(timer.duration(), Duration::from_secs(1));\n ```",
&["_self"],
)
.register_documented(
"elapsed",
|_self: R<::bevy_time::Timer>| {
let output: V<::core::time::Duration> = {
{
let output: V<::core::time::Duration> = ::bevy_time::Timer::elapsed(
&_self,
)
.into();
output
}
};
output
},
" Returns the time elapsed on the timer. Guaranteed to be between 0.0 and `duration`.\n Will only equal `duration` when the timer is finished and non repeating.\n See also [`Stopwatch::elapsed`](Stopwatch::elapsed).\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Once);\n timer.tick(Duration::from_secs_f32(0.5));\n assert_eq!(timer.elapsed(), Duration::from_secs_f32(0.5));\n ```",
&["_self"],
)
.register_documented(
"elapsed_secs",
|_self: R<::bevy_time::Timer>| {
let output: f32 = {
{
let output: f32 = ::bevy_time::Timer::elapsed_secs(&_self)
.into();
output
}
};
output
},
" Returns the time elapsed on the timer as an `f32`.\n See also [`Timer::elapsed`](Timer::elapsed).",
&["_self"],
)
.register_documented(
"elapsed_secs_f64",
|_self: R<::bevy_time::Timer>| {
let output: f64 = {
{
let output: f64 = ::bevy_time::Timer::elapsed_secs_f64(&_self)
.into();
output
}
};
output
},
" Returns the time elapsed on the timer as an `f64`.\n See also [`Timer::elapsed`](Timer::elapsed).",
&["_self"],
)
.register_documented(
"eq",
|_self: R<::bevy_time::Timer>, other: R<::bevy_time::Timer>| {
let output: bool = {
{
let output: bool = <::bevy_time::Timer as ::core::cmp::PartialEq<
::bevy_time::Timer,
>>::eq(&_self, &other)
.into();
output
}
};
output
},
"",
&["_self", "other"],
)
.register_documented(
"finish",
|mut _self: M<::bevy_time::Timer>| {
let output: () = {
{
let output: () = ::bevy_time::Timer::finish(&mut _self).into();
output
}
};
output
},
" Finishes the timer.\n # Examples\n ```\n # use bevy_time::*;\n let mut timer = Timer::from_seconds(1.5, TimerMode::Once);\n timer.finish();\n assert!(timer.is_finished());\n ```",
&["_self"],
)
.register_documented(
"fraction",
|_self: R<::bevy_time::Timer>| {
let output: f32 = {
{
let output: f32 = ::bevy_time::Timer::fraction(&_self).into();
output
}
};
output
},
" Returns the fraction of the timer elapsed time (goes from 0.0 to 1.0).\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(2.0, TimerMode::Once);\n timer.tick(Duration::from_secs_f32(0.5));\n assert_eq!(timer.fraction(), 0.25);\n ```",
&["_self"],
)
.register_documented(
"fraction_remaining",
|_self: R<::bevy_time::Timer>| {
let output: f32 = {
{
let output: f32 = ::bevy_time::Timer::fraction_remaining(&_self)
.into();
output
}
};
output
},
" Returns the fraction of the timer remaining time (goes from 1.0 to 0.0).\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(2.0, TimerMode::Once);\n timer.tick(Duration::from_secs_f32(0.5));\n assert_eq!(timer.fraction_remaining(), 0.75);\n ```",
&["_self"],
)
.register_documented(
"from_seconds",
|duration: f32, mode: V<::bevy_time::TimerMode>| {
let output: V<::bevy_time::Timer> = {
{
let output: V<::bevy_time::Timer> = ::bevy_time::Timer::from_seconds(
duration,
mode.into_inner(),
)
.into();
output
}
};
output
},
" Creates a new timer with a given duration in seconds.\n # Example\n ```\n # use bevy_time::*;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Once);\n ```",
&["duration", "mode"],
)
.register_documented(
"is_finished",
|_self: R<::bevy_time::Timer>| {
let output: bool = {
{
let output: bool = ::bevy_time::Timer::is_finished(&_self)
.into();
output
}
};
output
},
" Returns `true` if the timer has reached its duration.\n For repeating timers, this method behaves identically to [`Timer::just_finished`].\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer_once = Timer::from_seconds(1.0, TimerMode::Once);\n timer_once.tick(Duration::from_secs_f32(1.5));\n assert!(timer_once.is_finished());\n timer_once.tick(Duration::from_secs_f32(0.5));\n assert!(timer_once.is_finished());\n let mut timer_repeating = Timer::from_seconds(1.0, TimerMode::Repeating);\n timer_repeating.tick(Duration::from_secs_f32(1.1));\n assert!(timer_repeating.is_finished());\n timer_repeating.tick(Duration::from_secs_f32(0.8));\n assert!(!timer_repeating.is_finished());\n timer_repeating.tick(Duration::from_secs_f32(0.6));\n assert!(timer_repeating.is_finished());\n ```",
&["_self"],
)
.register_documented(
"is_paused",
|_self: R<::bevy_time::Timer>| {
let output: bool = {
{
let output: bool = ::bevy_time::Timer::is_paused(&_self).into();
output
}
};
output
},
" Returns `true` if the timer is paused.\n See also [`Stopwatch::is_paused`](Stopwatch::is_paused).\n # Examples\n ```\n # use bevy_time::*;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Once);\n assert!(!timer.is_paused());\n timer.pause();\n assert!(timer.is_paused());\n timer.unpause();\n assert!(!timer.is_paused());\n ```",
&["_self"],
)
.register_documented(
"just_finished",
|_self: R<::bevy_time::Timer>| {
let output: bool = {
{
let output: bool = ::bevy_time::Timer::just_finished(&_self)
.into();
output
}
};
output
},
" Returns `true` only on the tick the timer reached its duration.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Once);\n timer.tick(Duration::from_secs_f32(1.5));\n assert!(timer.just_finished());\n timer.tick(Duration::from_secs_f32(0.5));\n assert!(!timer.just_finished());\n ```",
&["_self"],
)
.register_documented(
"mode",
|_self: R<::bevy_time::Timer>| {
let output: V<::bevy_time::TimerMode> = {
{
let output: V<::bevy_time::TimerMode> = ::bevy_time::Timer::mode(
&_self,
)
.into();
output
}
};
output
},
" Returns the mode of the timer.\n # Examples\n ```\n # use bevy_time::*;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Repeating);\n assert_eq!(timer.mode(), TimerMode::Repeating);\n ```",
&["_self"],
)
.register_documented(
"new",
|duration: V<::core::time::Duration>, mode: V<::bevy_time::TimerMode>| {
let output: V<::bevy_time::Timer> = {
{
let output: V<::bevy_time::Timer> = ::bevy_time::Timer::new(
duration.into_inner(),
mode.into_inner(),
)
.into();
output
}
};
output
},
" Creates a new timer with a given duration.\n See also [`Timer::from_seconds`](Timer::from_seconds).",
&["duration", "mode"],
)
.register_documented(
"pause",
|mut _self: M<::bevy_time::Timer>| {
let output: () = {
{
let output: () = ::bevy_time::Timer::pause(&mut _self).into();
output
}
};
output
},
" Pauses the Timer. Disables the ticking of the timer.\n See also [`Stopwatch::pause`](Stopwatch::pause).\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Once);\n timer.pause();\n timer.tick(Duration::from_secs_f32(0.5));\n assert_eq!(timer.elapsed_secs(), 0.0);\n ```",
&["_self"],
)
.register_documented(
"remaining",
|_self: R<::bevy_time::Timer>| {
let output: V<::core::time::Duration> = {
{
let output: V<::core::time::Duration> = ::bevy_time::Timer::remaining(
&_self,
)
.into();
output
}
};
output
},
" Returns the remaining time using Duration\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(2.0, TimerMode::Once);\n timer.tick(Duration::from_secs_f32(0.5));\n assert_eq!(timer.remaining(), Duration::from_secs_f32(1.5));\n ```",
&["_self"],
)
.register_documented(
"remaining_secs",
|_self: R<::bevy_time::Timer>| {
let output: f32 = {
{
let output: f32 = ::bevy_time::Timer::remaining_secs(&_self)
.into();
output
}
};
output
},
" Returns the remaining time in seconds\n # Examples\n ```\n # use bevy_time::*;\n use std::cmp::Ordering;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(2.0, TimerMode::Once);\n timer.tick(Duration::from_secs_f32(0.5));\n let result = timer.remaining_secs().total_cmp(&1.5);\n assert_eq!(Ordering::Equal, result);\n ```",
&["_self"],
)
.register_documented(
"reset",
|mut _self: M<::bevy_time::Timer>| {
let output: () = {
{
let output: () = ::bevy_time::Timer::reset(&mut _self).into();
output
}
};
output
},
" Resets the timer. The reset doesn't affect the `paused` state of the timer.\n See also [`Stopwatch::reset`](Stopwatch::reset).\n Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Once);\n timer.tick(Duration::from_secs_f32(1.5));\n timer.reset();\n assert!(!timer.is_finished());\n assert!(!timer.just_finished());\n assert_eq!(timer.elapsed_secs(), 0.0);\n ```",
&["_self"],
)
.register_documented(
"set_duration",
|mut _self: M<::bevy_time::Timer>, duration: V<::core::time::Duration>| {
let output: () = {
{
let output: () = ::bevy_time::Timer::set_duration(
&mut _self,
duration.into_inner(),
)
.into();
output
}
};
output
},
" Sets the duration of the timer.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(1.5, TimerMode::Once);\n timer.set_duration(Duration::from_secs(1));\n assert_eq!(timer.duration(), Duration::from_secs(1));\n ```",
&["_self", "duration"],
)
.register_documented(
"set_elapsed",
|mut _self: M<::bevy_time::Timer>, time: V<::core::time::Duration>| {
let output: () = {
{
let output: () = ::bevy_time::Timer::set_elapsed(
&mut _self,
time.into_inner(),
)
.into();
output
}
};
output
},
" Sets the elapsed time of the timer without any other considerations.\n See also [`Stopwatch::set`](Stopwatch::set).\n #\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Once);\n timer.set_elapsed(Duration::from_secs(2));\n assert_eq!(timer.elapsed(), Duration::from_secs(2));\n // the timer is not finished even if the elapsed time is greater than the duration.\n assert!(!timer.is_finished());\n ```",
&["_self", "time"],
)
.register_documented(
"set_mode",
|mut _self: M<::bevy_time::Timer>, mode: V<::bevy_time::TimerMode>| {
let output: () = {
{
let output: () = ::bevy_time::Timer::set_mode(
&mut _self,
mode.into_inner(),
)
.into();
output
}
};
output
},
" Sets the mode of the timer.\n # Examples\n ```\n # use bevy_time::*;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Repeating);\n timer.set_mode(TimerMode::Once);\n assert_eq!(timer.mode(), TimerMode::Once);\n ```",
&["_self", "mode"],
)
.register_documented(
"times_finished_this_tick",
|_self: R<::bevy_time::Timer>| {
let output: u32 = {
{
let output: u32 = ::bevy_time::Timer::times_finished_this_tick(
&_self,
)
.into();
output
}
};
output
},
" Returns the number of times a repeating timer\n finished during the last [`tick`](Timer<T>::tick) call.\n For non repeating-timers, this method will only ever\n return 0 or 1.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Repeating);\n timer.tick(Duration::from_secs_f32(6.0));\n assert_eq!(timer.times_finished_this_tick(), 6);\n timer.tick(Duration::from_secs_f32(2.0));\n assert_eq!(timer.times_finished_this_tick(), 2);\n timer.tick(Duration::from_secs_f32(0.5));\n assert_eq!(timer.times_finished_this_tick(), 0);\n ```",
&["_self"],
)
.register_documented(
"unpause",
|mut _self: M<::bevy_time::Timer>| {
let output: () = {
{
let output: () = ::bevy_time::Timer::unpause(&mut _self).into();
output
}
};
output
},
" Unpauses the Timer. Resumes the ticking of the timer.\n See also [`Stopwatch::unpause()`](Stopwatch::unpause).\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut timer = Timer::from_seconds(1.0, TimerMode::Once);\n timer.pause();\n timer.tick(Duration::from_secs_f32(0.5));\n timer.unpause();\n timer.tick(Duration::from_secs_f32(0.5));\n assert_eq!(timer.elapsed_secs(), 0.5);\n ```",
&["_self"],
);
let registry = world.get_resource_or_init::<AppTypeRegistry>();
let mut registry = registry.write();
registry
.register_type_data::<::bevy_time::Timer, bevy_mod_scripting_bindings::MarkAsGenerated>();
}
pub(crate) fn register_timer_mode_functions(world: &mut World) {
bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::<
::bevy_time::TimerMode,
>::new(world)
.register_documented(
"clone",
|_self: R<::bevy_time::TimerMode>| {
let output: V<::bevy_time::TimerMode> = {
{
let output: V<::bevy_time::TimerMode> = <::bevy_time::TimerMode as ::core::clone::Clone>::clone(
&_self,
)
.into();
output
}
};
output
},
"",
&["_self"],
)
.register_documented(
"eq",
|_self: R<::bevy_time::TimerMode>, other: R<::bevy_time::TimerMode>| {
let output: bool = {
{
let output: bool = <::bevy_time::TimerMode as ::core::cmp::PartialEq<
::bevy_time::TimerMode,
>>::eq(&_self, &other)
.into();
output
}
};
output
},
"",
&["_self", "other"],
);
let registry = world.get_resource_or_init::<AppTypeRegistry>();
let mut registry = registry.write();
registry
.register_type_data::<::bevy_time::TimerMode, bevy_mod_scripting_bindings::MarkAsGenerated>(
);
}
pub(crate) fn register_virtual_functions(world: &mut World) {
bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::<
::bevy_time::Virtual,
>::new(world)
.register_documented(
"clone",
|_self: R<::bevy_time::Virtual>| {
let output: V<::bevy_time::Virtual> = {
{
let output: V<::bevy_time::Virtual> = <::bevy_time::Virtual as ::core::clone::Clone>::clone(
&_self,
)
.into();
output
}
};
output
},
"",
&["_self"],
);
let registry = world.get_resource_or_init::<AppTypeRegistry>();
let mut registry = registry.write();
registry
.register_type_data::<::bevy_time::Virtual, bevy_mod_scripting_bindings::MarkAsGenerated>();
}
pub(crate) fn register_delayed_command_queue_functions(world: &mut World) {
bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::<
::bevy_time::DelayedCommandQueue,
>::new(world);
let registry = world.get_resource_or_init::<AppTypeRegistry>();
let mut registry = registry.write();
registry
.register_type_data::<
::bevy_time::DelayedCommandQueue,
bevy_mod_scripting_bindings::MarkAsGenerated,
>();
}
pub(crate) fn register_stopwatch_functions(world: &mut World) {
bevy_mod_scripting_bindings::function::namespace::NamespaceBuilder::<
::bevy_time::Stopwatch,
>::new(world)
.register_documented(
"clone",
|_self: R<::bevy_time::Stopwatch>| {
let output: V<::bevy_time::Stopwatch> = {
{
let output: V<::bevy_time::Stopwatch> = <::bevy_time::Stopwatch as ::core::clone::Clone>::clone(
&_self,
)
.into();
output
}
};
output
},
"",
&["_self"],
)
.register_documented(
"elapsed",
|_self: R<::bevy_time::Stopwatch>| {
let output: V<::core::time::Duration> = {
{
let output: V<::core::time::Duration> = ::bevy_time::Stopwatch::elapsed(
&_self,
)
.into();
output
}
};
output
},
" Returns the elapsed time since the last [`reset`](Stopwatch::reset)\n of the stopwatch.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut stopwatch = Stopwatch::new();\n stopwatch.tick(Duration::from_secs(1));\n assert_eq!(stopwatch.elapsed(), Duration::from_secs(1));\n ```\n # See Also\n [`elapsed_secs`](Stopwatch::elapsed_secs) - if an `f32` value is desirable instead.\n [`elapsed_secs_f64`](Stopwatch::elapsed_secs_f64) - if an `f64` is desirable instead.",
&["_self"],
)
.register_documented(
"elapsed_secs",
|_self: R<::bevy_time::Stopwatch>| {
let output: f32 = {
{
let output: f32 = ::bevy_time::Stopwatch::elapsed_secs(&_self)
.into();
output
}
};
output
},
" Returns the elapsed time since the last [`reset`](Stopwatch::reset)\n of the stopwatch, in seconds.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut stopwatch = Stopwatch::new();\n stopwatch.tick(Duration::from_secs(1));\n assert_eq!(stopwatch.elapsed_secs(), 1.0);\n ```\n # See Also\n [`elapsed`](Stopwatch::elapsed) - if a `Duration` is desirable instead.\n [`elapsed_secs_f64`](Stopwatch::elapsed_secs_f64) - if an `f64` is desirable instead.",
&["_self"],
)
.register_documented(
"elapsed_secs_f64",
|_self: R<::bevy_time::Stopwatch>| {
let output: f64 = {
{
let output: f64 = ::bevy_time::Stopwatch::elapsed_secs_f64(
&_self,
)
.into();
output
}
};
output
},
" Returns the elapsed time since the last [`reset`](Stopwatch::reset)\n of the stopwatch, in seconds, as `f64`.\n # See Also\n [`elapsed`](Stopwatch::elapsed) - if a `Duration` is desirable instead.\n [`elapsed_secs`](Stopwatch::elapsed_secs) - if an `f32` is desirable instead.",
&["_self"],
)
.register_documented(
"eq",
|_self: R<::bevy_time::Stopwatch>, other: R<::bevy_time::Stopwatch>| {
let output: bool = {
{
let output: bool = <::bevy_time::Stopwatch as ::core::cmp::PartialEq<
::bevy_time::Stopwatch,
>>::eq(&_self, &other)
.into();
output
}
};
output
},
"",
&["_self", "other"],
)
.register_documented(
"is_paused",
|_self: R<::bevy_time::Stopwatch>| {
let output: bool = {
{
let output: bool = ::bevy_time::Stopwatch::is_paused(&_self)
.into();
output
}
};
output
},
" Returns `true` if the stopwatch is paused.\n # Examples\n ```\n # use bevy_time::*;\n let mut stopwatch = Stopwatch::new();\n assert!(!stopwatch.is_paused());\n stopwatch.pause();\n assert!(stopwatch.is_paused());\n stopwatch.unpause();\n assert!(!stopwatch.is_paused());\n ```",
&["_self"],
)
.register_documented(
"new",
|| {
let output: V<::bevy_time::Stopwatch> = {
{
let output: V<::bevy_time::Stopwatch> = ::bevy_time::Stopwatch::new()
.into();
output
}
};
output
},
" Create a new unpaused `Stopwatch` with no elapsed time.\n # Examples\n ```\n # use bevy_time::*;\n let stopwatch = Stopwatch::new();\n assert_eq!(stopwatch.elapsed_secs(), 0.0);\n assert_eq!(stopwatch.is_paused(), false);\n ```",
&[],
)
.register_documented(
"pause",
|mut _self: M<::bevy_time::Stopwatch>| {
let output: () = {
{
let output: () = ::bevy_time::Stopwatch::pause(&mut _self)
.into();
output
}
};
output
},
" Pauses the stopwatch. Any call to [`tick`](Stopwatch::tick) while\n paused will not have any effect on the elapsed time.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut stopwatch = Stopwatch::new();\n stopwatch.pause();\n stopwatch.tick(Duration::from_secs_f32(1.5));\n assert!(stopwatch.is_paused());\n assert_eq!(stopwatch.elapsed_secs(), 0.0);\n ```",
&["_self"],
)
.register_documented(
"reset",
|mut _self: M<::bevy_time::Stopwatch>| {
let output: () = {
{
let output: () = ::bevy_time::Stopwatch::reset(&mut _self)
.into();
output
}
};
output
},
" Resets the stopwatch. The reset doesn't affect the paused state of the stopwatch.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut stopwatch = Stopwatch::new();\n stopwatch.tick(Duration::from_secs_f32(1.5));\n stopwatch.reset();\n assert_eq!(stopwatch.elapsed_secs(), 0.0);\n ```",
&["_self"],
)
.register_documented(
"set_elapsed",
|mut _self: M<::bevy_time::Stopwatch>, time: V<::core::time::Duration>| {
let output: () = {
{
let output: () = ::bevy_time::Stopwatch::set_elapsed(
&mut _self,
time.into_inner(),
)
.into();
output
}
};
output
},
" Sets the elapsed time of the stopwatch.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut stopwatch = Stopwatch::new();\n stopwatch.set_elapsed(Duration::from_secs_f32(1.0));\n assert_eq!(stopwatch.elapsed_secs(), 1.0);\n ```",
&["_self", "time"],
)
.register_documented(
"unpause",
|mut _self: M<::bevy_time::Stopwatch>| {
let output: () = {
{
let output: () = ::bevy_time::Stopwatch::unpause(&mut _self)
.into();
output
}
};
output
},
" Unpauses the stopwatch. Resume the effect of ticking on elapsed time.\n # Examples\n ```\n # use bevy_time::*;\n use std::time::Duration;\n let mut stopwatch = Stopwatch::new();\n stopwatch.pause();\n stopwatch.tick(Duration::from_secs_f32(1.0));\n stopwatch.unpause();\n stopwatch.tick(Duration::from_secs_f32(1.0));\n assert!(!stopwatch.is_paused());\n assert_eq!(stopwatch.elapsed_secs(), 1.0);\n ```",
&["_self"],
);
let registry = world.get_resource_or_init::<AppTypeRegistry>();
let mut registry = registry.write();
registry
.register_type_data::<::bevy_time::Stopwatch, bevy_mod_scripting_bindings::MarkAsGenerated>(
);
}
impl Plugin for BevyTimeScriptingPlugin {
fn build(&self, app: &mut App) {
let mut world = app.world_mut();
register_fixed_functions(&mut world);
register_real_functions(&mut world);
register_timer_functions(&mut world);
register_timer_mode_functions(&mut world);
register_virtual_functions(&mut world);
register_delayed_command_queue_functions(&mut world);
register_stopwatch_functions(&mut world);
}
}