15 lines
421 B
C#
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));
|
|
}
|
|
} |