Added factory functions for TweenChannel because 'TweenChannel.new(TweenChannel.ArbitrationMode.REPLACE)' is kind of tedious to write.

This commit is contained in:
blujai831 2024-01-06 19:16:28 -08:00
parent 0cfdf81b48
commit 4d2d82b199
No known key found for this signature in database
GPG Key ID: DDC31A0363AA5E66
1 changed files with 12 additions and 0 deletions

View File

@ -29,6 +29,18 @@ func _init(
) -> void:
arbitration_mode = p_arbitration_mode
## Creates a TweenChannel which arbitrates by yielding.
static func make_yielding() -> TweenChannel:
return new(ArbitrationMode.YIELD)
## Creates a TweenChannel which arbitrates by replacing.
static func make_replacing() -> TweenChannel:
return new(ArbitrationMode.REPLACE)
## Creates a TweenChannel which arbitrates by ignoring.
static func make_ignoring() -> TweenChannel:
return new(ArbitrationMode.IGNORE)
## Returns target.create_tween() if and when arbitration_mode allows.
##
## "If:" if arbitration_mode is IGNORE and there is a current tween,