ajout de panneaux de contrôles, de paramètres et refactorisation de la gestion de l'audio
This commit is contained in:
@@ -6,6 +6,51 @@ class_name ControlAnimationPlayer
|
||||
|
||||
@export_tool_button("Test Shake", "Callable") var shake_action = shake
|
||||
@export_tool_button("Test Bounce", "Callable") var bounce_action = bounce
|
||||
@export_tool_button("Test Appear", "Callable") var appear_action = appear
|
||||
@export_tool_button("Test Disappear", "Callable") var disappear_action = disappear
|
||||
|
||||
func disappear(
|
||||
duration : float = 0.3,
|
||||
offset : int = 20,
|
||||
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
|
||||
):
|
||||
add_tween(
|
||||
"modulate",
|
||||
Color.TRANSPARENT,
|
||||
duration,
|
||||
transition_type
|
||||
)
|
||||
|
||||
await add_tween(
|
||||
"position",
|
||||
target.position + Vector2.UP * offset,
|
||||
duration,
|
||||
transition_type
|
||||
).finished
|
||||
|
||||
target.position += Vector2.DOWN * offset
|
||||
|
||||
func appear(
|
||||
duration : float = 0.3,
|
||||
offset : int = 20,
|
||||
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
|
||||
):
|
||||
add_tween(
|
||||
"modulate",
|
||||
Color.WHITE,
|
||||
duration,
|
||||
transition_type
|
||||
).finished
|
||||
|
||||
target.position += Vector2.UP * offset
|
||||
|
||||
await add_tween(
|
||||
"position",
|
||||
target.position + Vector2.DOWN * offset,
|
||||
duration,
|
||||
transition_type
|
||||
).finished
|
||||
|
||||
|
||||
func bounce(
|
||||
duration : float = 0.4,
|
||||
@@ -60,4 +105,5 @@ func add_tween(
|
||||
var tween : Tween = get_tree().create_tween()
|
||||
tween.set_trans(transition_type)
|
||||
tween.tween_property(target, property, value, seconds)
|
||||
tween.set_pause_mode(Tween.TWEEN_PAUSE_PROCESS)
|
||||
return tween
|
||||
Reference in New Issue
Block a user