15 lines
743 B
C#
15 lines
743 B
C#
using System;
|
|
using Godot;
|
|
|
|
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 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, Delegate? onScopeCreated = null);
|
|
} |