Added timer to image node to check if fle changed (#152)

This commit is contained in:
Rodolphe Suescun 2020-08-23 12:39:12 +02:00
parent 9eeeaef0c5
commit 1860036c55
1 changed files with 13 additions and 0 deletions

View File

@ -2,10 +2,19 @@ tool
extends MMGenTexture
class_name MMGenImage
var timer : Timer
"""
Texture generator from image
"""
func _ready() -> void:
timer = Timer.new()
add_child(timer)
timer.wait_time = 5
timer.start()
timer.connect("timeout", self, "_on_timeout")
func get_type() -> String:
return "image"
@ -19,3 +28,7 @@ func set_parameter(n : String, v) -> void:
.set_parameter(n, v)
if n == "image":
texture.load(v)
func _on_timeout():
set_parameter("image", get_parameter("image"))