1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-21 23:54:23 +00:00

Add randomize_on_ready to TimerStddev

This commit is contained in:
Steffo 2024-04-24 05:24:06 +02:00
parent 60fb711f4f
commit c0c82adef4
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -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()