You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
668 B

  1. extends Node
  2. export var target_path : NodePath = ".."
  3. signal on_interact_pressed
  4. signal on_interact_released
  5. func _ready():
  6. if target_path:
  7. var target_node = get_node(target_path)
  8. if target_node != null and target_node.has_method("on_interact_pressed"):
  9. self.connect("on_interact_pressed", target_node, "on_interact_pressed")
  10. if target_node != null and target_node.has_method("on_interact_released"):
  11. self.connect("on_interact_released", target_node, "on_interact_released")
  12. func on_interact_pressed(interactor):
  13. emit_signal("on_interact_pressed", interactor)
  14. func on_interact_released(interactor):
  15. emit_signal("on_interact_released", interactor)