feat: automatic injection of elements in scene.

This commit is contained in:
redglow
2026-07-17 15:14:40 +02:00
parent 659baff30c
commit 5ad3af84b2
15 changed files with 86 additions and 219 deletions
+18
View File
@@ -0,0 +1,18 @@
using Godot;
using GodotHostTest.GodotDI;
using GodotHostTest.Interfaces;
using Microsoft.Extensions.DependencyInjection;
namespace GodotHostTest.Game;
public partial class LevelServiceSource : RootServiceSource
{
[Export] private TargetSpawner _targetSpawner = null!;
protected override void Configure(IServiceCollection serviceCollection)
{
serviceCollection
.AddSingleton<ITargetCollector>(_targetSpawner)
.AddSingleton<ITargetSpawner>(_targetSpawner);
}
}