add file open

This commit is contained in:
2020-08-07 22:40:04 +08:00
parent c1e3f992aa
commit f9bedd2c62
115 changed files with 9835 additions and 1096 deletions

View File

@@ -120,27 +120,15 @@ function DBTextures.download(name, url, callback)
if File.Exists(localPath) then
_url = Path.Combine("file://", localPath)
end
local assetType
if MyUtl.isImage(name) then
assetType = CLAssetType.texture
else
assetType = CLAssetType.bytes
end
local www =
WWWEx.get(
_url,
nil,
CLAssetType.texture,
CLAssetType.bytes,
function(content, orgs)
isDownoading[name] = nil
if content then
local bytes
if assetType == CLAssetType.texture then
bytes = content:GetRawTextureData()
else
bytes = content
end
local bytes = content
Directory.CreateDirectory(Path.GetDirectoryName(localPath))
File.WriteAllBytes(localPath, bytes)
Utl.doCallback(downloadCallback[name], content, localPath)
@@ -162,6 +150,7 @@ function DBTextures.download(name, url, callback)
2
)
isDownoading[name] = www
return www
end
return DBTextures