30 lines
486 B
GDScript
30 lines
486 B
GDScript
class_name Counter extends RefCounted
|
|
|
|
var is_active: bool = false
|
|
|
|
|
|
var sec: float = 1
|
|
var value: float = 0
|
|
|
|
#func set_inactive() -> void:
|
|
#is_active = false
|
|
#
|
|
#func set_active() -> void:
|
|
#is_active = true
|
|
|
|
func is_reached() -> bool:
|
|
if value >= sec:
|
|
return true
|
|
else:
|
|
return false
|
|
|
|
func add_delta(delta: float) -> void:
|
|
value += delta
|
|
|
|
|
|
func debug() -> void:
|
|
print(is_active, " | ", value, " of ", sec)
|
|
|
|
#func _init():
|
|
|