Workers, lighting, and loading
This commit is contained in:
14
client/Scripts/Component/LightLoader.gd
Normal file
14
client/Scripts/Component/LightLoader.gd
Normal file
@ -0,0 +1,14 @@
|
||||
extends Area2D
|
||||
|
||||
func _ready():
|
||||
connect("body_entered", self, "_on_body_enter")
|
||||
connect("body_exited", self, "_on_body_exit")
|
||||
get_parent().get_node("Light2D").enabled = false
|
||||
|
||||
func _on_body_enter(body):
|
||||
if body.has_method("add_interactable"):
|
||||
get_parent().get_node("Light2D").enabled = true
|
||||
|
||||
func _on_body_exit(body):
|
||||
if body.has_method("remove_interactable"):
|
||||
get_parent().get_node("Light2D").enabled = false
|
Reference in New Issue
Block a user