@869421306 写道:
cocos creator 2.2.2
iOS平台
我用下面代码下载远程图片,下载回调成功,用cc.loader.load加载不到资源,下载成功后,怎样把资源加载到内存使用?let url = "http://xxx.png"; let fileName = "xxx.png"; let fullPath = jsb.fileUtils.getWritablePath() + fileName; let downloader = new jsb.Downloader(); downloader.setOnFileTaskSuccess(() => { cc.log("Download file succ"); cc.loader.load(url, (resource: any) => { // TODO }); }); downloader.setOnTaskError(() => { cc.warn("Download " + fileName + " failed") }); downloader.createDownloadFileTask(url, fullPath);
帖子: 3
参与者: 1