|
@@ -107,7 +107,10 @@ bool Timer::has_autostart() const {
|
|
|
return autostart;
|
|
|
}
|
|
|
|
|
|
-void Timer::start() {
|
|
|
+void Timer::start(float p_time) {
|
|
|
+ if (p_time > 0) {
|
|
|
+ set_wait_time(p_time);
|
|
|
+ }
|
|
|
time_left = wait_time;
|
|
|
_set_process(true);
|
|
|
}
|
|
@@ -185,7 +188,7 @@ void Timer::_bind_methods() {
|
|
|
ClassDB::bind_method(D_METHOD("set_autostart", "enable"), &Timer::set_autostart);
|
|
|
ClassDB::bind_method(D_METHOD("has_autostart"), &Timer::has_autostart);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("start"), &Timer::start);
|
|
|
+ ClassDB::bind_method(D_METHOD("start", "time_sec"), &Timer::start, DEFVAL(-1));
|
|
|
ClassDB::bind_method(D_METHOD("stop"), &Timer::stop);
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("set_paused", "paused"), &Timer::set_paused);
|