mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-22 08:04:23 +00:00
Add randomize_on_ready
to TimerStddev
This commit is contained in:
parent
60fb711f4f
commit
c0c82adef4
1 changed files with 6 additions and 0 deletions
|
@ -9,6 +9,7 @@ class_name TimerStddev
|
||||||
@export var deviation: float = 1.0
|
@export var deviation: float = 1.0
|
||||||
@export_range(0, 10, 0.1, "or_greater") var min_secs: float = 0.0
|
@export_range(0, 10, 0.1, "or_greater") var min_secs: float = 0.0
|
||||||
@export_range(0, 10, 0.1, "or_greater") var max_secs: float = 2.0
|
@export_range(0, 10, 0.1, "or_greater") var max_secs: float = 2.0
|
||||||
|
@export var randomize_on_ready: bool = true
|
||||||
|
|
||||||
|
|
||||||
func randomize_wait_time() -> void:
|
func randomize_wait_time() -> void:
|
||||||
|
@ -17,3 +18,8 @@ func randomize_wait_time() -> void:
|
||||||
Random.rng.randfn(mean_secs, deviation),
|
Random.rng.randfn(mean_secs, deviation),
|
||||||
max_secs
|
max_secs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
if randomize_on_ready:
|
||||||
|
randomize_wait_time()
|
||||||
|
|
Loading…
Reference in a new issue