2020-01-26 16:31:20 +01:00
|
|
|
extends NPC
|
|
|
|
|
2020-01-26 22:31:48 +01:00
|
|
|
const diffPerSecond = 5
|
|
|
|
var _arrived_distance_threshold = 0.1
|
2020-01-26 16:31:20 +01:00
|
|
|
|
2020-01-26 22:31:48 +01:00
|
|
|
var _navPath: Path
|
|
|
|
var _followPath: PathFollow
|
|
|
|
var _current_nav_index = 0
|
2020-01-26 16:31:20 +01:00
|
|
|
|
|
|
|
func _ready():
|
2020-01-26 22:31:48 +01:00
|
|
|
_followPath = get_node("../") as PathFollow
|
|
|
|
_navPath = get_node("../../") as Path
|
|
|
|
|
2020-01-26 16:31:20 +01:00
|
|
|
func _process(_delta):
|
2020-01-28 17:35:07 +01:00
|
|
|
if _followPath != null:
|
|
|
|
_followPath.offset += diffPerSecond * _delta
|
2020-01-28 22:44:24 +01:00
|
|
|
if _followPath.unit_offset > 0.99:
|
|
|
|
#Logger.info("freeing worker! name: " + name)
|
|
|
|
queue_free()
|