State machine rework

This commit is contained in:
Rendo 2025-12-09 22:34:17 +05:00
commit 87919ed890
25 changed files with 102 additions and 76 deletions

View file

@ -3,12 +3,12 @@ extends WeaponState
@export var damage: int
var end_it: bool = true
func enter() -> void:
func _enter() -> void:
machine.animation_player.play(machine.animation_prefix + "attack")
attack()
machine.animation_player.animation_finished.connect(on_animation_finished)
func exit() -> void:
func _exit() -> void:
machine.animation_player.animation_finished.disconnect(on_animation_finished)
end_it = false
@ -24,8 +24,8 @@ func on_animation_finished(animation):
attack()
machine.animation_player.play(machine.animation_prefix + "attack")
func use_begin() -> void:
func _use_begin() -> void:
end_it = false
func use_end() -> void:
func _use_end() -> void:
end_it = true