22 lines
360 B
GDScript
22 lines
360 B
GDScript
extends State
|
|
var target
|
|
func enter_state(n):
|
|
if n is Unit:
|
|
target=n
|
|
get_player().set_target(n.global_position)
|
|
get_player().attack()
|
|
pass
|
|
func update_state(delta):
|
|
pass
|
|
func update_state_phy(delta):
|
|
if get_player().is_attack_finished():
|
|
change_to_state("idle")
|
|
func exit_state():
|
|
target=null
|
|
pass
|
|
|
|
func process_message(type:String,n):
|
|
|
|
|
|
pass
|