mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-30 16:01:53 +08:00
13 lines
264 B
GDScript
13 lines
264 B
GDScript
|
|
class_name CooldownTimer
|
||
|
|
|
||
|
|
var cooldown: float = 100
|
||
|
|
var lastStart: int = 0
|
||
|
|
|
||
|
|
func isCooldowned():
|
||
|
|
return WorldManager.getTime() - lastStart >= cooldown
|
||
|
|
func startCooldown():
|
||
|
|
var state = isCooldowned()
|
||
|
|
if state:
|
||
|
|
lastStart = WorldManager.getTime()
|
||
|
|
return state
|