21 lines
449 B
C#
21 lines
449 B
C#
using Godot;
|
|
using Newlon.Components.Level;
|
|
|
|
namespace Newlon.Components.Plants;
|
|
|
|
public partial class PlantSunSpawner : Node2D
|
|
{
|
|
[Export]
|
|
private PackedScene _sunScene;
|
|
[Export]
|
|
private int _amountPerSun;
|
|
|
|
public void Spawn()
|
|
{
|
|
var sun = _sunScene.Instantiate<Sun>();
|
|
sun.amount = _amountPerSun;
|
|
|
|
PoolContainer.Instance.Projectiles.AddChild(sun);
|
|
sun.GlobalPosition = GlobalPosition;
|
|
}
|
|
}
|