Wait 0.05s while loading resource
This commit is contained in:
parent
f9f42095cf
commit
6643152e93
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue