You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because AsyncLoader.load_scene_async_with_cb is async, there is a chance that the target, instance, and cb have been deleted before use. So we would have to do a bunch of checks for each callback. Rather than do that, have a callback that is called on any of these situations.
func_on_orange_loaded_cb(instance : Node, data : Dictionary) ->void:
# Just return if target is invalidifnotis_instance_valid(target):
return# Just return if instance is invalidifnotis_instance_valid(instance):
return# Just return if the cb is invalidifcb!=nullandnotcb.is_valid():
return
func_on_error(instance : Node, data : Dictionary) ->void:
# Just return if target is invalidifnotis_instance_valid(target):
return# Just return if instance is invalidifnotis_instance_valid(instance):
return# Just return if the cb is invalidifcb!=nullandnotcb.is_valid():
returnAsyncLoader.start(groups, 100, funcref(self,"_on_error" ))
The text was updated successfully, but these errors were encountered:
Because AsyncLoader.load_scene_async_with_cb is async, there is a chance that the target, instance, and cb have been deleted before use. So we would have to do a bunch of checks for each callback. Rather than do that, have a callback that is called on any of these situations.
The text was updated successfully, but these errors were encountered: