Added timer to image node to check if fle changed (#152)
This commit is contained in:
parent
9eeeaef0c5
commit
1860036c55
|
@ -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"))
|
||||
|
||||
|
|
Loading…
Reference in New Issue