Immediately changed my mind about previous commit and changed default tween channel arbitration mode back to YIELD. Instead implemented a constructor which takes arbitration mode as an optional parameter. This way I can initialize arbitration mode to REPLACE as needed in variable declarations of type TweenChannel, rather than having to do it in _ready, and still have the default be YIELD.

This commit is contained in:
blujai831 2024-01-06 18:47:57 -08:00
parent ebae0648c8
commit 0cfdf81b48
No known key found for this signature in database
GPG Key ID: DDC31A0363AA5E66
1 changed files with 7 additions and 1 deletions

View File

@ -19,10 +19,16 @@ enum ArbitrationMode {
## and it changes while the call is yielding, then the in-progress call
## still will not return until its turn, as though arbitration_mode
## were still YIELD.
var arbitration_mode := ArbitrationMode.REPLACE
var arbitration_mode: ArbitrationMode
## Tween currently running if any, else null.
var current_tween: Tween = null
## Initializer. Sets arbitration mode.
func _init(
p_arbitration_mode: ArbitrationMode = ArbitrationMode.YIELD
) -> void:
arbitration_mode = p_arbitration_mode
## Returns target.create_tween() if and when arbitration_mode allows.
##
## "If:" if arbitration_mode is IGNORE and there is a current tween,