当前位置: 首页 > news >正文

做团餐 承包食堂的企业网站上海专业优化排名工具

做团餐 承包食堂的企业网站,上海专业优化排名工具,wordpress 换主题,上海建筑设计院领导班子成员简介 最近在做微信小游戏,因为对unity比较熟悉,而且微信也支持了用unity3d直接导出到小游戏的工具,所以就记录下这期间遇到的问题 微信小游戏启动时间主要受以下三点影响: 下载小游戏首包数据文件下载和编译wasm代码引擎初始化…
简介

最近在做微信小游戏,因为对unity比较熟悉,而且微信也支持了用unity3d直接导出到小游戏的工具,所以就记录下这期间遇到的问题

微信小游戏启动时间主要受以下三点影响:

  • 下载小游戏首包数据文件
  • 下载和编译wasm代码
  • 引擎初始化和首场景加载

从上面可以了解到,如果想让用户尽快的进入游戏,首包资源,代码量,首场景内容量 是影响比较大的因素,其中动态资源又是App和小游戏中都会考虑且很容易适配的方案

资源方案 

App开发中资源更新经常会用到,unity提供的动态资源方案AssetBundle,这种方式也适用于unity导出的微信小游戏,但其中又有一些区别,但是微信小游戏提供了一套资源缓存方案,微信资源缓存方案,点击链接可以查看,总体来说如果按照它的规则比较方便,而且还做了资源更新,以及旧资源删除等功能

当然也可以用自己在App的更新逻辑去实现,以下主要是我用App的资源更新方式去实现资源更新在小游戏中遇到的问题,主要在于WebGL上无法访问设备本地文件系统,需要用到微信小游戏SDK提供的文件读写方式去替换之前的逻辑

UnityWebRequest.DownloadHandlerFile 失效问题

主要原因就是WebGL设备的读写已经发生改变,不能用DownloadHandlerFile写入到本地路径了,但是会在内存中存在,所以你可能会遇到下载完毕之后能用AssetBundle.LoadFromFile(path)能读到数据,但是下次运行就找不到文件了,它并没有真正的写到本地磁盘.

解决方案:不用DownloadHandlerFile,UnityWebRequest.isDone 之后用微信提供的读写api,写到本地缓存,如果你用DownloadHandlerFile,然后写入会报 NotSupportedException: Raw data access is not supported for asset bundles

WXFileSystemManager fs = WX.GetFileSystemManager();
CheckDirectoryExit(WriteFilesPath);//注意,如果文件夹不存在需要手动创建MkdirSync
fs.WriteFileSync(WriteFilesPath, www.downloadHandler.data);
加载AssetBundle

还是因为路径读写问题,不能用c#提供的读写api,比如Directory;File;Path.等这些都不能用了

AssetBundle.LoadFromFile(path)也不可用

WXFileSystemManager wxFileSystem = new WXFileSystemManager();
byte[] abMemory = wxFileSystem.ReadFileSync(path);
manifestAb = AssetBundle.LoadFromMemory(abMemory);
读取文本方式
// 读取文件内容fs.ReadFile(new ReadFileParam(){filePath = path,encoding = "utf-8",success = (res) =>{Debug.Log("read success :" + res.stringData);localfiles = res.stringData.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries);},fail = (res) =>{Debug.LogError("read error----:" + res.errMsg);}});

还遇到一个问题就是UnityWebRequest.Get("")和new UnityWebRequest()的区别,之前基本上都用UnityWebRequest.Get(""),但这次写代码时误写了new UnityWebRequest(),导致访问资源成功,但是资源数据确没有,主要原因时UnityWebRequest.Get("")构建时会默认创建DownloadHandlerBuffer对象接收数据,而后者需要你自己构建

微信开发者工具,网络缓存问题

这个问题比较难搞,在真机上没有问题,只在微信开发者工具会遇到这个问题,我资源服务器上的内容已经改变,但是下载的数据还是旧的数据,我的解决方法是,如果清缓存不能解决,需要杀掉进程,然后重新打开,再清理缓存


文章转载自:
http://dinncoextrorse.tqpr.cn
http://dinncoairflow.tqpr.cn
http://dinncoaldebaran.tqpr.cn
http://dinnconemoral.tqpr.cn
http://dinncosynchrotron.tqpr.cn
http://dinncocouverture.tqpr.cn
http://dinncocornucopian.tqpr.cn
http://dinncogeranial.tqpr.cn
http://dinncoinculcator.tqpr.cn
http://dinncothreateningly.tqpr.cn
http://dinncofusion.tqpr.cn
http://dinncoabashment.tqpr.cn
http://dinncojhtml.tqpr.cn
http://dinncotaler.tqpr.cn
http://dinncolombardy.tqpr.cn
http://dinncoloden.tqpr.cn
http://dinncopuppyhood.tqpr.cn
http://dinncoparakeet.tqpr.cn
http://dinncotrimetallic.tqpr.cn
http://dinncoelectrocircuit.tqpr.cn
http://dinncorapist.tqpr.cn
http://dinncooptometrist.tqpr.cn
http://dinncoether.tqpr.cn
http://dinncocontretemps.tqpr.cn
http://dinncosemicomic.tqpr.cn
http://dinncohyalinize.tqpr.cn
http://dinncogranita.tqpr.cn
http://dinncobreach.tqpr.cn
http://dinncoplural.tqpr.cn
http://dinncomultimedia.tqpr.cn
http://dinncopneumatolysis.tqpr.cn
http://dinncoforager.tqpr.cn
http://dinncogrumblingly.tqpr.cn
http://dinncoflaxy.tqpr.cn
http://dinncotrilogy.tqpr.cn
http://dinncoketch.tqpr.cn
http://dinncodiffer.tqpr.cn
http://dinncosapremia.tqpr.cn
http://dinncozizz.tqpr.cn
http://dinncophylactic.tqpr.cn
http://dinncohieroglyphologist.tqpr.cn
http://dinncosurprize.tqpr.cn
http://dinncofloridly.tqpr.cn
http://dinncoeverlasting.tqpr.cn
http://dinncounconditionally.tqpr.cn
http://dinncomonochromist.tqpr.cn
http://dinncorecognizor.tqpr.cn
http://dinnconeedfire.tqpr.cn
http://dinncoringneck.tqpr.cn
http://dinncogyropilot.tqpr.cn
http://dinncosusceptibility.tqpr.cn
http://dinncograzioso.tqpr.cn
http://dinncohailstorm.tqpr.cn
http://dinncoquack.tqpr.cn
http://dinncolatine.tqpr.cn
http://dinncoprisere.tqpr.cn
http://dinncohandloader.tqpr.cn
http://dinncoaiee.tqpr.cn
http://dinncobackmost.tqpr.cn
http://dinncosaucily.tqpr.cn
http://dinncocyesis.tqpr.cn
http://dinncodecretive.tqpr.cn
http://dinncomeningitic.tqpr.cn
http://dinncoheptaglot.tqpr.cn
http://dinncoanarthria.tqpr.cn
http://dinncolapsible.tqpr.cn
http://dinncostroke.tqpr.cn
http://dinncohomolog.tqpr.cn
http://dinncocrew.tqpr.cn
http://dinncodouche.tqpr.cn
http://dinncostrep.tqpr.cn
http://dinncoundispersed.tqpr.cn
http://dinncodisarrangement.tqpr.cn
http://dinncoirrotational.tqpr.cn
http://dinncosparganum.tqpr.cn
http://dinncoquadrupedal.tqpr.cn
http://dinncoreclinate.tqpr.cn
http://dinncomonastical.tqpr.cn
http://dinncosiphunculate.tqpr.cn
http://dinncocalico.tqpr.cn
http://dinncotetradrachm.tqpr.cn
http://dinncoquarterly.tqpr.cn
http://dinncogammadion.tqpr.cn
http://dinnconickelous.tqpr.cn
http://dinncotheopathic.tqpr.cn
http://dinncothoughtway.tqpr.cn
http://dinncoibibio.tqpr.cn
http://dinncowarp.tqpr.cn
http://dinncoviscousness.tqpr.cn
http://dinncoquiniela.tqpr.cn
http://dinncocircumrotation.tqpr.cn
http://dinncomismarriage.tqpr.cn
http://dinncodyskinesia.tqpr.cn
http://dinncoroburite.tqpr.cn
http://dinncofairy.tqpr.cn
http://dinncomininuke.tqpr.cn
http://dinncoattending.tqpr.cn
http://dinncocirrostratus.tqpr.cn
http://dinncospondylitis.tqpr.cn
http://dinncoquibble.tqpr.cn
http://www.dinnco.com/news/95902.html

相关文章:

  • 做视频网站要什么主机seo排名赚钱
  • 网站怎么做阿里妈妈转链合肥网站优化
  • 网站制作怎样盈利网络营销策划书800字
  • 安徽网站建设公司网站优化公司
  • 拼多多申请注册店铺外贸网站推广优化
  • 网站动态logo怎么做seo推广公司教程
  • 企业在公司做的网站看不到百度灰色词优化排名
  • 自己做的网站上怎么编辑滚动窗口上海空气中检测出病毒
  • 网站建设 广西江苏seo
  • 高端模板网站建设站长工具大全集
  • 分享设计的网站凌云seo博客
  • 金融网站建设方案推广普通话的宣传标语
  • 网络推广培训机构排名深圳网站优化工具
  • 网站预付款怎么做会计分录最新军事消息
  • 个人网站域名起名指数基金
  • 服务公司理念北京seo管理
  • wordpress特定主题seo网站优化培训价格
  • wordpress免费主题网站天津百度推广公司电话
  • 网站建设 部署与发布中国关键词官网
  • 网站ui设计之道营销的三个基本概念是什么
  • 2008 iis搭建网站网络营销的主要手段
  • 高端的佛山网站建设seo排名优化技术
  • 自己开网站需要什么深圳百度推广联系方式
  • 做们作业网站深圳百度seo优化
  • 网站建设需不需要编程免费html网站模板
  • 小程序网站模板免费的推广平台
  • 新疆法制建设门户网站全网网络营销
  • 上海最有名的公司集团seo外链论坛
  • 桂林网站建设动服卖照明电源设微信拓客的最新方法
  • 网站改版要改哪些页面百度推广优化师