21 lines
426 B
GDScript
21 lines
426 B
GDScript
extends Area
|
|
|
|
var dialog = null
|
|
|
|
func _ready():
|
|
pass # Replace with function body.
|
|
|
|
func _on_DialogTrigger_body_entered(body):
|
|
if body.get_parent() != Util.player:
|
|
return
|
|
dialog = Dialogic.start("obelisk")
|
|
add_child(dialog)
|
|
|
|
func _on_DialogTrigger_body_exited(body):
|
|
if body.get_parent() != Util.player:
|
|
return
|
|
if dialog != null:
|
|
if is_a_parent_of(dialog):
|
|
call_deferred("remove_child", dialog)
|
|
dialog = null
|