feat: some application of source code generator
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Godot;
|
||||
using OwofGames.GodotLume;
|
||||
|
||||
namespace GodotHostTest.AetherBind;
|
||||
|
||||
@@ -13,11 +14,11 @@ public static class SceneInstantiatorExtensions
|
||||
/// <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.
|
||||
/// scene, with the provider as argument.
|
||||
/// </param>
|
||||
/// <returns>The created node, with its dependencies satisfied.</returns>
|
||||
private static T Instantiate<T>(this ISceneInstantiator sceneInstantiator, PackedScene packedScene,
|
||||
Delegate? onScopeCreated = null) where T : Node
|
||||
Action<IProvider>? onScopeCreated = null) where T : Node
|
||||
{
|
||||
return (T)sceneInstantiator.Instantiate(packedScene, onScopeCreated);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user