diff --git a/resmgr.gd b/resmgr.gd index ede2057..3145358 100644 --- a/resmgr.gd +++ b/resmgr.gd @@ -42,7 +42,9 @@ func loadres(resource_name:String,resource_path:String,replace:bool = false) -> logger.error("CORE/resmgr.gd",err["error"]) return err["code"] # Load the resource - resources.merge({resource_name:ResourceLoader.load(resource_path)}) + var resource_loaded = ResourceLoader.load(resource_path) + await get_tree().create_timer(0.05).timeout + resources.merge({resource_name:resource_loaded}) return core.Errors.OK # Unloads a resource @@ -67,7 +69,7 @@ func loadbatch(batch:Dictionary,replace:bool = false) -> int: return err["code"] for i in batch: # Call loadres() method for every item in batch - loadres(i,batch[i],replace) + await loadres(i,batch[i],replace) return core.Errors.OK # Unloads a batch of resources