1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-21 15:44:23 +00:00

Remove target parameter from spawn

This commit is contained in:
Steffo 2024-04-19 03:47:34 +02:00
parent fd91909d04
commit ba8dd72ed5
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -1,16 +1,14 @@
@icon("res://behaviours/spawner.svg")
extends Node2D
extends Area2D
class_name Spawner
signal spawned(entity: Node2D)
@export var scene: PackedScene
@export var default_target: Node2D
@export var target: Node2D
func spawn(target: Node2D = null):
if not target:
target = default_target
func spawn():
if not target:
target = MainGame.get_ancestor(self).default_spawn_parent
var entity = scene.instantiate()