Files
godot-host-test/Game/Turret.cs
T
2026-07-11 10:54:02 +02:00

15 lines
421 B
C#

using Godot;
using GodotHostTest.GodotDI;
namespace GodotHostTest.Game;
public partial class Turret : Sprite2D
{
[Inject] private readonly ISceneInstantiator _sceneInstantiator = null!;
[Export] private PackedScene _projectilePackedScene = null!;
public override void _Ready()
{
GetTree().CreateTimer(1).Timeout += () => AddChild(_sceneInstantiator.Instantiate(_projectilePackedScene));
}
}