basic ECS spawner
This commit is contained in:
14
GECS/entities/Spawner/e_spawn_point.gd
Normal file
14
GECS/entities/Spawner/e_spawn_point.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
@tool
|
||||
class_name E_SpawnPoint
|
||||
extends Entity
|
||||
|
||||
@export var spawn_prefab: PackedScene
|
||||
@export var spawn_frequency: float = -1
|
||||
|
||||
func on_ready():
|
||||
if has_component(C_SpawnPoint):
|
||||
var c_spawn_point = get_component(C_SpawnPoint) as C_SpawnPoint
|
||||
if spawn_prefab != null && spawn_prefab.can_instantiate():
|
||||
c_spawn_point.spawn_prefab = spawn_prefab
|
||||
if spawn_frequency > 0:
|
||||
c_spawn_point.spawn_frequency = spawn_frequency
|
||||
Reference in New Issue
Block a user