QuitDialog.gd 427 B

1234567891011121314151617
  1. extends Control
  2. signal cancelled
  3. var is_active := false
  4. func _physics_process(delta: float) -> void:
  5. modulate.a = lerpf(modulate.a, int(is_active), delta * 15)
  6. if Input.is_action_just_released("ui_back") and is_active:
  7. cancelled.emit()
  8. is_active = false
  9. $AnimationPlayer.stop()
  10. func start() -> void:
  11. $AnimationPlayer.play("Animation")
  12. is_active = true
  13. await $AnimationPlayer.animation_finished
  14. get_tree().quit()