Godot Version
4.4.1.stable
Question
Is it possible to reference the lambda or the parent function of a certain scope of code? For instance:
Loader.resource_loaded.connect(
func():
current_level = ResourceLoader.load_threaded_get(level).instantiate()
# disconnect to this lambda to the signal
)
In this statement ^ I create a new lambda/callable and connect it to my custom Loader autoload signal resource_loaded and then use it to set the current_level and disconnect to the signal resource_loaded. However, I can’t do that since there is no way to reference the lambda, I would have to move all this code to a different function, which is not ideal.
Is there anyway to reference it? So far I’ve been looking and I haven’t found a concrete way.