combo.gd 452 B

12345678910111213141516
  1. extends Control
  2. var paths := []
  3. func _enter_tree():
  4. for ch in $GridContainer.get_children():
  5. paths.append(NodePath(str(get_path()) + "/GridContainer/" + str(ch.name)))
  6. # Sets a dedicated Multiplayer API for each branch.
  7. for path in paths:
  8. get_tree().set_multiplayer(MultiplayerAPI.create_default_interface(), path)
  9. func _exit_tree():
  10. # Clear the branch-specific Multiplayer API.
  11. for path in paths:
  12. get_tree().set_multiplayer(null, path)