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

义乌做公司网站wordpress 没有保存

义乌做公司网站,wordpress 没有保存,网络推广专员,企业信息网官网图片资源冗余#xff1a; UPR unity的性能优化工具检查资源 1.检查纹理读/写标记 开启纹理资源的读/写标志会导致双倍的内存占用 检查Inspector - Advanced - Read/Write Enabled选项 2.检查纹理资源alpha通道 如果纹理的alpha通道全部为0#xff0c;或者全部为2…图片资源冗余 UPR unity的性能优化工具检查资源 1.检查纹理读/写标记 开启纹理资源的读/写标志会导致双倍的内存占用 检查Inspector - Advanced - Read/Write Enabled选项 2.检查纹理资源alpha通道 如果纹理的alpha通道全部为0或者全部为255可以认为其中不包含有效信息此时应禁用’Alpha源’标志否则会浪费这部分的内存。 检查Inspector - Alpha Source选项 3.检查纯色纹理 纯色纹理的使用可能可以由一些设置来代替。由于某些情况下纯色纹理是必不可少的此警告仅会在所使用的纹理较大(大于设定值, 默认为16x16)时才会触发。 Custom Parameters: heightThreshold : 16widthThreshold : 16 4.检查重复纹理 问题1 方案可继承AssetPostprocessor对资源改动的时候检查是否有开启读/写标记 问题23 4 方案定期检查 其中问题23只需要判断颜色通道比较简单不做解释 问题4 解决 1.遍历所有贴图 用字典缓存 找到重复的资源 2.找到项目下所有材质并且缓存 3.找到引用该重复贴图的材质 4.判断该材质所有引用贴图字段 如有和重复贴图相同 则替换 5.删除重复贴图 代码 static void RemoveReportTexture(string[] searchInFolders){Dictionarystring, string md5dic new Dictionarystring, string();HashSetint deleteTexInsId new HashSetint();//string[] guids AssetDatabase.FindAssets(t:Texture, new string[] { Assets/actor, Assets/FX, Assets/scene, });string[] guids AssetDatabase.FindAssets(t:Texture, searchInFolders);string[] matFiles null;string[] matFilesContent null;//Debug.Log(贴图 guids.Length);//1.遍历所有贴图 用字典缓存 找到重复的资源 int progress 0;foreach (var assetGuid in guids){string assetPath AssetDatabase.GUIDToAssetPath(assetGuid); // 从GUID拿到资源的路径bool isCancel EditorUtility.DisplayCancelableProgressBar(移除重复的贴图, assetPath, (float)progress / (float)guids.Length);progress;string md5 GetMD5Hash(Path.Combine(Directory.GetCurrentDirectory(), assetPath)); //获取md5string path;md5dic.TryGetValue(md5, out path);if (path null){md5dic[md5] assetPath;// Debug.Log(assetPath);}else{Debug.LogFormat(资源重复{0}{1}, path, assetPath);if (matFiles null){//2.找到所有材质并且缓存Liststring withoutExtensions new Liststring() { .mat };matFiles Directory.GetFiles(Application.dataPath, *.*, SearchOption.AllDirectories).Where(s withoutExtensions.Contains(Path.GetExtension(s).ToLower())).ToArray();matFilesContent new string[matFiles.Length];for (int i 0; i matFiles.Length; i){matFilesContent[i] File.ReadAllText(matFiles[i]);}}Texture2D tex AssetDatabase.LoadAssetAtPathTexture2D(path); //保留的图Texture2D deleteTex AssetDatabase.LoadAssetAtPathTexture2D(assetPath); //删除的图//3.找到引用该贴图的所有材质for (int startIndex 0; startIndex matFiles.Length; startIndex){string file GetRelativeAssetsPath(matFiles[startIndex]);if (Regex.IsMatch(matFilesContent[startIndex], assetGuid)){Material material AssetDatabase.LoadAssetAtPathMaterial(file);bool isUseTex false;var textureNames material.GetTexturePropertyNames();//Debug.Log(遍历所有需要修改替换贴图的材质 file ,贴图数: textureNames.Length);//4.判断该材质所有引用贴图字段 如有和重复贴图相同 则替换for (int j 0; j textureNames.Length; j){if (material.HasTexture(textureNames[j])) // 该方法获取不到不属于该shader的贴图切换材质后unity会保留之前shader的信息{Texture texture material.GetTexture(textureNames[j]); // 获取材质上的贴图引用if (texture ! null){//Debug.Log(获取到图片名字 texture.name);if (texture.name deleteTex.name){isUseTex true;material.SetTexture(textureNames[j], tex);Debug.Log(修改的材质 file 的贴图 assetPath ,assetGuid: assetGuid ,替换为 path 修改材质propertyName textureNames[j]);EditorUtility.SetDirty(material);}}}}}}//5.替换完所有材质删除该重复贴图//if(isChangeSucceedCount ! referencesMatPath.Count)//{// Debug.LogError(修改失败isChangeSucceedCount isChangeSucceedCount referencesMatPath.Count referencesMatPath.Count);//}//else//{// AssetDatabase.DeleteAsset(assetPath);// Debug.LogError(修改成功);//}Debug.Log(DeleteAsset: assetPath);deleteTexInsId.Add(deleteTex.GetInstanceID());AssetDatabase.DeleteAsset(assetPath);}}AssetDatabase.SaveAssets();EditorUtility.ClearProgressBar();if (deleteTexInsId.Count 0){int checkProgress 0;for (int startIndex 0; startIndex matFiles.Length; startIndex){string file GetRelativeAssetsPath(matFiles[startIndex]);bool isCancel EditorUtility.DisplayCancelableProgressBar(检查材质是否缺少贴图, file, (float)checkProgress / (float)matFiles.Length);checkProgress;Material material AssetDatabase.LoadAssetAtPathMaterial(file);SerializedObject serializedMaterial new SerializedObject(material);SerializedProperty texturesProperty serializedMaterial.FindProperty(m_SavedProperties.m_TexEnvs);foreach (SerializedProperty textureProperty in texturesProperty){string propertyName textureProperty.displayName;SerializedProperty textureReference textureProperty.FindPropertyRelative(second.m_Texture);// 检查贴图引用是否丢失if (material.shader.FindPropertyIndex(propertyName) 0 textureReference.objectReferenceValue null deleteTexInsId.Contains(textureReference.objectReferenceInstanceIDValue)){Debug.LogError($移除重复的模型贴图导致 Missing texture in material: {material.name}, Property: {propertyName});}}}EditorUtility.ClearProgressBar();}} 主界面图集过多 主界面UI也就几个界面但通过unity的Memory Profiler去看内存的时候 却发现了30个左右的图集原因是因为拼接资源的时候没注意导致一个界面依赖了好几个图集简单解决就是把主界面和其他界面一起用到的图片放到公用图集里去然后就调整对应的图集代码界面
文章转载自:
http://www.morning.zynjt.cn.gov.cn.zynjt.cn
http://www.morning.dbfwq.cn.gov.cn.dbfwq.cn
http://www.morning.mlwpr.cn.gov.cn.mlwpr.cn
http://www.morning.dxqwm.cn.gov.cn.dxqwm.cn
http://www.morning.fwrr.cn.gov.cn.fwrr.cn
http://www.morning.hcwjls.com.gov.cn.hcwjls.com
http://www.morning.tgpgx.cn.gov.cn.tgpgx.cn
http://www.morning.nnhrp.cn.gov.cn.nnhrp.cn
http://www.morning.bmrqz.cn.gov.cn.bmrqz.cn
http://www.morning.jksgy.cn.gov.cn.jksgy.cn
http://www.morning.pzcjq.cn.gov.cn.pzcjq.cn
http://www.morning.nzms.cn.gov.cn.nzms.cn
http://www.morning.ksqzd.cn.gov.cn.ksqzd.cn
http://www.morning.ggnfy.cn.gov.cn.ggnfy.cn
http://www.morning.fdhwh.cn.gov.cn.fdhwh.cn
http://www.morning.ngqdp.cn.gov.cn.ngqdp.cn
http://www.morning.zrbpx.cn.gov.cn.zrbpx.cn
http://www.morning.bhjyh.cn.gov.cn.bhjyh.cn
http://www.morning.cjcry.cn.gov.cn.cjcry.cn
http://www.morning.attorneysportorange.com.gov.cn.attorneysportorange.com
http://www.morning.dqbpf.cn.gov.cn.dqbpf.cn
http://www.morning.dglszn.com.gov.cn.dglszn.com
http://www.morning.hcgbm.cn.gov.cn.hcgbm.cn
http://www.morning.mnsmb.cn.gov.cn.mnsmb.cn
http://www.morning.wjlnz.cn.gov.cn.wjlnz.cn
http://www.morning.tqbqb.cn.gov.cn.tqbqb.cn
http://www.morning.nqmhf.cn.gov.cn.nqmhf.cn
http://www.morning.qdrrh.cn.gov.cn.qdrrh.cn
http://www.morning.tldfp.cn.gov.cn.tldfp.cn
http://www.morning.dfrenti.com.gov.cn.dfrenti.com
http://www.morning.xjkr.cn.gov.cn.xjkr.cn
http://www.morning.thxfn.cn.gov.cn.thxfn.cn
http://www.morning.qhkdt.cn.gov.cn.qhkdt.cn
http://www.morning.xlndf.cn.gov.cn.xlndf.cn
http://www.morning.jzfrl.cn.gov.cn.jzfrl.cn
http://www.morning.bkqw.cn.gov.cn.bkqw.cn
http://www.morning.mhpmw.cn.gov.cn.mhpmw.cn
http://www.morning.qszyd.cn.gov.cn.qszyd.cn
http://www.morning.kgfsz.cn.gov.cn.kgfsz.cn
http://www.morning.cfynn.cn.gov.cn.cfynn.cn
http://www.morning.xnflx.cn.gov.cn.xnflx.cn
http://www.morning.hgtr.cn.gov.cn.hgtr.cn
http://www.morning.yhywx.cn.gov.cn.yhywx.cn
http://www.morning.sgbjh.cn.gov.cn.sgbjh.cn
http://www.morning.nyqnk.cn.gov.cn.nyqnk.cn
http://www.morning.dnhdp.cn.gov.cn.dnhdp.cn
http://www.morning.qcslh.cn.gov.cn.qcslh.cn
http://www.morning.xgmf.cn.gov.cn.xgmf.cn
http://www.morning.bljcb.cn.gov.cn.bljcb.cn
http://www.morning.kqzt.cn.gov.cn.kqzt.cn
http://www.morning.frsxt.cn.gov.cn.frsxt.cn
http://www.morning.knryp.cn.gov.cn.knryp.cn
http://www.morning.ltpmy.cn.gov.cn.ltpmy.cn
http://www.morning.nclps.cn.gov.cn.nclps.cn
http://www.morning.jcrfm.cn.gov.cn.jcrfm.cn
http://www.morning.wfdlz.cn.gov.cn.wfdlz.cn
http://www.morning.wdpbq.cn.gov.cn.wdpbq.cn
http://www.morning.jzmqk.cn.gov.cn.jzmqk.cn
http://www.morning.rcntx.cn.gov.cn.rcntx.cn
http://www.morning.vnuwdy.cn.gov.cn.vnuwdy.cn
http://www.morning.hxcuvg.cn.gov.cn.hxcuvg.cn
http://www.morning.nkdmd.cn.gov.cn.nkdmd.cn
http://www.morning.ddfp.cn.gov.cn.ddfp.cn
http://www.morning.dlmqn.cn.gov.cn.dlmqn.cn
http://www.morning.gtbjc.cn.gov.cn.gtbjc.cn
http://www.morning.rhsg.cn.gov.cn.rhsg.cn
http://www.morning.glkhx.cn.gov.cn.glkhx.cn
http://www.morning.muzishu.com.gov.cn.muzishu.com
http://www.morning.wrtxk.cn.gov.cn.wrtxk.cn
http://www.morning.jjrsk.cn.gov.cn.jjrsk.cn
http://www.morning.brsgw.cn.gov.cn.brsgw.cn
http://www.morning.wfcqr.cn.gov.cn.wfcqr.cn
http://www.morning.gjqnn.cn.gov.cn.gjqnn.cn
http://www.morning.xpgwz.cn.gov.cn.xpgwz.cn
http://www.morning.tbbxn.cn.gov.cn.tbbxn.cn
http://www.morning.lylkh.cn.gov.cn.lylkh.cn
http://www.morning.bbmx.cn.gov.cn.bbmx.cn
http://www.morning.gtdf.cn.gov.cn.gtdf.cn
http://www.morning.lfcfn.cn.gov.cn.lfcfn.cn
http://www.morning.hnkkf.cn.gov.cn.hnkkf.cn
http://www.tj-hxxt.cn/news/253340.html

相关文章:

  • 商城网站建设报价单沧州网站建设哪家专业
  • 用旧手机做网站做搜狗pc网站排名
  • 特优项目网站建设方案制作网页的软件s开头
  • 传媒公司网站模板吉林网络公司哪家好
  • 电影网站开发背景深圳外贸网站外贸网站建设
  • 建筑工程东莞网站建设用wordpress插件推荐
  • 个体工商户 网站建设软件开发需要学什么语言
  • 绞铜机 东莞网站建设WordPress上下拖动效果
  • 网站建设开发报价方案模板企业网站建设门户
  • 怎么用网站的二级目录做排名十大招商平台
  • 西安做网站app电子商务网站建设专业主修课程
  • 炒域名 网站nodejs网站毕设代做
  • 网站建设策划 优帮云教育平台
  • 网站可以不进行icp备案吗wordpress主页布局
  • 江宁网站建设价位网站个人建设
  • 网站开发技术语言自己网站开发
  • 不做网站只做推广可以么百度网盘官网
  • 网站赏析案例花垣县建设局网站
  • 西安创意网站建设filp pdf wordpress
  • 阿里云网站空间做商城流程网站域名空间代理
  • 网站建设实习内容济宁住房和城乡建设局网站
  • 网站备案现场核验物流平台系统
  • 做网站专业今天的新闻 最新消息
  • interidea 做网站公司起名字大全免费三个字
  • 专业做招聘的网站有哪些长沙人才网最新招聘信息
  • 无锡住房和城乡建设局网站网站换模板
  • 大连手机自适应网站建设费用最简单的网站开发国际化
  • 临海网站制作费用如何记账湖州微信网站建设
  • iis5建设网站大型游戏平台排行榜
  • 企业网站的设计风格wordpress必做