19 lines
577 B
GDScript

class_name SkillInstance
extends Node
var state: StateComponent
var animation: AnimationComponent
var voice: VoiceComponent
var movement: MovementComponent
func _enter_tree():
state = get_parent().get_node("State") as StateComponent
animation = get_parent().get_node("Animation") as AnimationComponent
voice = get_parent().get_node("Voice") as VoiceComponent
movement = get_parent().get_node("Movement") as MovementComponent
state.current = StateComponent.State.Skill
func end():
animation.animations.speed_scale = 1.0
state.current = state.next_state()
queue_free()