PausePopup.gd 363 B

1234567891011121314151617181920212223
  1. extends Popup
  2. func trigger_pause() -> void:
  3. popup()
  4. get_tree().paused = true
  5. func end_pause() -> void:
  6. get_tree().paused = false
  7. func _input(event: InputEvent) -> void:
  8. if event is InputEventKey:
  9. if event.is_action_pressed("ui_home"):
  10. if get_tree().paused:
  11. hide()
  12. else:
  13. trigger_pause()
  14. func _on_self_popup_hide() -> void:
  15. end_pause()