fix(sprint-14): guarantee _start_close_lid tween callback when lid and gift are null
This commit is contained in:
@@ -63,13 +63,13 @@ func _on_lid_opened() -> void:
|
|||||||
func _start_close_lid() -> void:
|
func _start_close_lid() -> void:
|
||||||
var lid: Node2D = get_node_or_null("Lid") as Node2D
|
var lid: Node2D = get_node_or_null("Lid") as Node2D
|
||||||
var gift: Node2D = get_node_or_null("Gift") as Node2D
|
var gift: Node2D = get_node_or_null("Gift") as Node2D
|
||||||
var tween: Tween = create_tween().set_parallel(true)
|
var tween: Tween = create_tween()
|
||||||
if lid != null:
|
if lid != null:
|
||||||
tween.tween_property(lid, "position:y", CLOSED_LID_Y, OPEN_DURATION)
|
tween.parallel().tween_property(lid, "position:y", CLOSED_LID_Y, OPEN_DURATION)
|
||||||
tween.tween_property(lid, "modulate:a", 1.0, OPEN_DURATION)
|
tween.parallel().tween_property(lid, "modulate:a", 1.0, OPEN_DURATION)
|
||||||
if gift != null:
|
if gift != null:
|
||||||
tween.tween_property(gift, "modulate:a", 0.0, OPEN_DURATION)
|
tween.parallel().tween_property(gift, "modulate:a", 0.0, OPEN_DURATION)
|
||||||
tween.finished.connect(_on_reset_complete)
|
tween.tween_callback(_on_reset_complete)
|
||||||
|
|
||||||
|
|
||||||
func _on_reset_complete() -> void:
|
func _on_reset_complete() -> void:
|
||||||
|
|||||||
Reference in New Issue
Block a user