ailock.gd 268 B

1234567891011121314
  1. extends Button
  2. var vsync_on: bool = false
  3. func _ready():
  4. update_vsync()
  5. func _on_pressed():
  6. vsync_on = !vsync_on
  7. update_vsync()
  8. func update_vsync():
  9. get_tree().get_root().get_child(0).disable_ai = vsync_on
  10. set_text("on" if vsync_on else "off")