fix debug errors and warnings

This commit is contained in:
2026-06-02 10:33:18 +02:00
parent 47a2bf5a2e
commit 97a8ce3f9c
44 changed files with 64 additions and 48 deletions

View File

@@ -33,7 +33,7 @@ func start_tween() -> void:
_tween_generation += 1
var current_gen = _tween_generation
var sorted_targets = targets.duplicate() if !targets.is_empty() else runtime_target_parent.get_children().duplicate()
var sorted_targets: Array[Control] = _get_current_targets()
match order:
AnimateOrder.TOP_TO_BOTTOM:
@@ -80,7 +80,23 @@ func start_tween() -> void:
func stop_tween() -> void:
is_running = false
_tween_generation += 1
var current_targets = targets if !targets.is_empty() else runtime_target_parent.get_children()
var current_targets: Array[Control] = _get_current_targets()
for target in current_targets:
if is_instance_valid(target):
TweenFX.stop_all(target)
func _get_current_targets() -> Array[Control]:
if !targets.is_empty():
return targets.duplicate()
var current_targets: Array[Control] = []
if runtime_target_parent == null:
return current_targets
for child in runtime_target_parent.get_children():
var target := child as Control
if target != null:
current_targets.append(target)
return current_targets