preload workers

This commit is contained in:
SyntaX 2020-01-28 11:47:16 +01:00
parent 40db91aec2
commit f53784c746
2 changed files with 1 additions and 3 deletions

View File

@ -208,7 +208,6 @@ transform = Transform( -4.37114e-008, 0, -1, 0, 1, 0, 1, 0, -4.37114e-008, 12.95
transform = Transform( -6.15088e-008, 0, 1.40716, 0, 1.40716, 0, -1.40716, 0, -6.15088e-008, 72.1424, -0.0216179, 64.9277 ) transform = Transform( -6.15088e-008, 0, 1.40716, 0, 1.40716, 0, -1.40716, 0, -6.15088e-008, 72.1424, -0.0216179, 64.9277 )
[node name="BuildingBlocks" type="Spatial" parent="NavigationMeshInstance"] [node name="BuildingBlocks" type="Spatial" parent="NavigationMeshInstance"]
visible = false
[node name="BuildingBlock" parent="NavigationMeshInstance/BuildingBlocks" instance=ExtResource( 13 )] [node name="BuildingBlock" parent="NavigationMeshInstance/BuildingBlocks" instance=ExtResource( 13 )]
transform = Transform( -4.37114e-008, 0, 1, 0, 1, 0, -1, 0, -4.37114e-008, -13, 0, -13 ) transform = Transform( -4.37114e-008, 0, 1, 0, 1, 0, -1, 0, -4.37114e-008, -13, 0, -13 )

View File

@ -6,12 +6,11 @@ export(float) var _offset
const SPAWN_TIME_MIN = 5000 # min spawntime in ms const SPAWN_TIME_MIN = 5000 # min spawntime in ms
const SPAWN_TIME_MAX = 8000 # max spawntime in ms const SPAWN_TIME_MAX = 8000 # max spawntime in ms
var _worker var _worker = preload("res://Characters/Worker/Worker.tscn")
var _lastSpawn = 0 # timestamp of last spawned worker var _lastSpawn = 0 # timestamp of last spawned worker
var _path: Path var _path: Path
func _ready(): func _ready():
_worker = load("res://Characters/Worker/Worker.tscn")
assert(null != _worker) assert(null != _worker)
_path = get_node(_nodepath) _path = get_node(_nodepath)