mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-22 08:04:23 +00:00
Remove target
parameter from spawn
This commit is contained in:
parent
fd91909d04
commit
ba8dd72ed5
1 changed files with 3 additions and 5 deletions
|
@ -1,16 +1,14 @@
|
||||||
@icon("res://behaviours/spawner.svg")
|
@icon("res://behaviours/spawner.svg")
|
||||||
extends Node2D
|
extends Area2D
|
||||||
class_name Spawner
|
class_name Spawner
|
||||||
|
|
||||||
signal spawned(entity: Node2D)
|
signal spawned(entity: Node2D)
|
||||||
|
|
||||||
@export var scene: PackedScene
|
@export var scene: PackedScene
|
||||||
@export var default_target: Node2D
|
@export var target: Node2D
|
||||||
|
|
||||||
|
|
||||||
func spawn(target: Node2D = null):
|
func spawn():
|
||||||
if not target:
|
|
||||||
target = default_target
|
|
||||||
if not target:
|
if not target:
|
||||||
target = MainGame.get_ancestor(self).default_spawn_parent
|
target = MainGame.get_ancestor(self).default_spawn_parent
|
||||||
var entity = scene.instantiate()
|
var entity = scene.instantiate()
|
||||||
|
|
Loading…
Reference in a new issue