17 lines
519 B
GDScript
17 lines
519 B
GDScript
extends WeaponState
|
|
|
|
|
|
func enter():
|
|
machine.animation_player.play(machine.animation_prefix+"plant")
|
|
machine.animation_player.animation_finished.connect(on_animation_finished)
|
|
|
|
func exit():
|
|
machine.animation_player.animation_finished.disconnect(on_animation_finished)
|
|
|
|
func on_animation_finished(animation: StringName):
|
|
if animation == machine.animation_prefix + "plant":
|
|
return_to_previous.emit()
|
|
|
|
func state_input(event: InputEvent) -> void:
|
|
if event.is_action_released("plr_bomb"):
|
|
return_to_previous.emit()
|