crash.gd 368 B

123456789101112131415161718192021
  1. class_name CrashEffect
  2. extends Node3D
  3. var _noise_finished: bool = false
  4. var _splash_finished: bool = false
  5. func _on_noise_finished() -> void:
  6. _noise_finished = true
  7. _die_if_completed()
  8. func _on_splash_finished() -> void:
  9. _splash_finished = true
  10. _die_if_completed()
  11. func _die_if_completed() -> void:
  12. if _noise_finished and _splash_finished:
  13. queue_free()