FlowerspotStatus.gd 651 B

123456789101112131415161718192021222324252627282930313233
  1. extends Node
  2. var all_active = true
  3. signal all_flowerspots_activated
  4. signal loading(status)
  5. func check_status():
  6. all_active = true
  7. print ("FlowerspotStatus load")
  8. var spots = get_tree().get_nodes_in_group("group_flowerspot")
  9. for s in spots:
  10. if not s.is_queued_for_deletion():
  11. if s.status == "inactive":
  12. all_active = false
  13. print(all_active)
  14. func on_load():
  15. check_status()
  16. print ("on load: all flowerspots active = " + str(all_active))
  17. emit_signal("loading", all_active)
  18. func on_flowerspot_activated():
  19. check_status()
  20. print ("all flowerspots active = " + str(all_active))
  21. emit_signal("all_flowerspots_activated")