using System; using Godot; namespace GodotHostTest.AetherBind; public static class SceneInstantiatorExtensions { /// /// Instantiate a packed scene, just like , but also looks for a scope between /// the top level children and triggers the dependency injection mechanism when found. /// /// The scene instantiator to use. /// The packed scene to instantiate. /// /// An optional callback invoked once the scope has been created, but before instantiating the /// scene. /// /// The created node, with its dependencies satisfied. private static T Instantiate(this ISceneInstantiator sceneInstantiator, PackedScene packedScene, Delegate? onScopeCreated = null) where T : Node { return (T)sceneInstantiator.Instantiate(packedScene, onScopeCreated); } }