feat: more plugin work and intra-scope communication

This commit is contained in:
redglow
2026-07-18 10:56:54 +02:00
parent 7c16dddbd0
commit ce58a3a2c2
22 changed files with 246 additions and 56 deletions
+6 -3
View File
@@ -1,3 +1,4 @@
using System;
using Godot;
namespace GodotHostTest.GodotDI;
@@ -5,16 +6,18 @@ namespace GodotHostTest.GodotDI;
public interface ISceneInstantiator
{
/// <summary>
/// Instantiate a packed scene, just like <see cref="PackedScene.Instantiate"/>, but also looks for a scope between the top level children and triggers the dependency injection mechanism when found.
/// Instantiate a packed scene, just like <see cref="PackedScene.Instantiate"/>, but also looks for a scope between the top level children of the instantiated scene and triggers the dependency injection mechanism when found.
/// </summary>
/// <param name="packedScene">The packed scene to instantiate.</param>
/// <param name="onScopeCreated">An optional callback invoked once the scope has been created, but before instantiating the scene.</param>
/// <returns>The created node, with its dependencies satisfied.</returns>
Node Instantiate(PackedScene packedScene);
Node Instantiate(PackedScene packedScene, Delegate? onScopeCreated = null);
/// <summary>
/// Instantiate a packed scene, just like <see cref="PackedScene.Instantiate{T}"/>, but also looks for a scope between the top level children and triggers the dependency injection mechanism when found.
/// </summary>
/// <param name="packedScene">The packed scene to instantiate.</param>
/// <param name="onScopeCreated">An optional callback invoked once the scope has been created, but before instantiating the scene.</param>
/// <returns>The created node, with its dependencies satisfied.</returns>
T Instantiate<T>(PackedScene packedScene) where T : Node;
T Instantiate<T>(PackedScene packedScene, Delegate? onScopeCreated = null) where T : Node;
}