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

做销售找客户的网站天津企业seo

做销售找客户的网站,天津企业seo,常熟高端网站建设,杭州网站建设公司哪家好本文主要解决在不打开unity的情况下搜索出无效引用的资源的方法 1. 概述 一般只要遍历一下目录里所有资源,判空一下就好了但有些情况下,不希望打开unity, 尤其希望是在资源整合时,想更快验证资源的合法性, 这对合并提交及出包验证时,都要较大的需求 2. 简单的验证方法 简单来…

本文主要解决在不打开unity的情况下搜索出无效引用的资源的方法

1. 概述

  1. 一般只要遍历一下目录里所有资源,判空一下就好了
  2. 但有些情况下,不希望打开unity, 尤其希望是在资源整合时,想更快验证资源的合法性, 这对合并提交及出包验证时,都要较大的需求

2. 简单的验证方法

  1. 简单来说,要直接分析untiy的资源文件, 而且unity资源大部分是文本文件
  2. 他们的文本格式大多是YAML, 如果直接使用PyYaml, 目前发现不行, 不过幸好, 格式相对简单, 通过分析属性的名称,再找到属性内容的方法,可以定位出Guid的值, 例如, 要查找XXX, YYY的值
import osGuidStr = "guid: "
GuidStrLen = len(GuidStr)class CheckAssetInfo:def __init__(self, filePath):self.filePath = filePathself.allGuids = []self.isInit = Falseself.checkValueNames = ["XXX", "YYY"]self.initData()def initData(self):if not self.isInit:self.allGuids = self.get_file_to_guids(self.filePath) self.isInit = Truedef get_all_guids(self):return self.allGuidsdef get_target_value(self, valueName, valueInfos):for i in range(len(valueInfos)):n, j = valueInfos[i]if n == valueName:return ireturn -1def get_file_to_guids(self, targetFilterPath):allGuids = []with open(targetFilterPath, 'r') as assetFile:contentLines = assetFile.readlines()valueInfos = self.get_all_value_index(contentLines)for checkName in self.checkValueNames:valueIndex = self.get_target_value(checkName, valueInfos)if valueIndex != -1:valueName, stline = valueInfos[valueIndex]valueName, endLine = valueInfos[valueIndex+1]allGuids.extend(self.get_value_guids(contentLines, stline, endLine))return allGuidsdef get_all_value_index(self, contentLines):valueInfos = []lineCount = len(contentLines)for i in range(lineCount):oneLine = contentLines[i]findIndex = oneLine.find(":")if findIndex != -1:valueName = oneLine[0:findIndex].strip()if valueName[0].isalpha():valueInfos.append((valueName, i))valueInfos.append(("", lineCount))return valueInfosdef get_value_guids(self, contentLines, startLineIndex, endLineIndex):allGuids = []for i in range(startLineIndex, endLineIndex):oneLine = contentLines[i]guidIndex = oneLine.find(GuidStr)if guidIndex != -1:endIndex = oneLine.find(", ", guidIndex)allGuids.append(oneLine[guidIndex + GuidStrLen: endIndex].strip())return allGuids
  1. 获得引用的GUID后,还要知道都有什么GUID的资源, 这个比较简单,只要分析meta文件就好, 以下就简单粗暴地遍历资源目录下的meta文件即可
class MetaInfo: def __init__(self, filePath):self.filePath = filePath; self.guid = self.get_guid_from_file(filePath)def get_guid_from_file(self, filePath):with open(filePath, 'r') as metaFile:allLine = metaFile.readlines()for oneLine in allLine:guidIndex = oneLine.find(GuidStr)if guidIndex != -1: return oneLine[guidIndex + GuidStrLen:len(oneLine)].strip()return ""class VegChecker: def __init__(self, baseDir):self.checkAssetDir = "Assets/checkDir" self.allAssetDir = "Assets"self.allAssetGuids = {}def get_all_target_files(self, targetDir, extName):res = []for root, dirs, files in os.walk(targetDir):for file in files:if os.path.splitext(file)[1] == extName:file_path = os.path.join(root, file)res.append(file_path)return resdef get_all_asset_guids(self):allMetaFiles = self.get_all_veg_files(self.allAssetDir, ".meta")for metaFile in allMetaFiles:metaInfo = MetaInfo(metaFile)self.allAssetGuids[metaInfo.guid] = Trueprint("Get total asset count meta count: " + str(len(self.allAssetGuids)))
  1. 获得要引用的GUID与所有的资源GUID,就很简单了,判断引用的GUID不在所有的资源GUID里就可以了
    def check_all_asset(self):res = Trueself.get_all_asset_guids()checkFiles = self.get_all_target_files(self.checkVegDir, ".asset")for oneFilter in checkFiles:assetInfo = CheckAssetInfo(oneFilter)for guid in assetInfo.allGuids:if not self.allAssetGuids.get(guid, False):print(f"fail to find guid {guid} in check asset {oneFilter}")res = Falsereturn res

3.Q&A

  1. 可能直接分析文件, 而且要大范围遍历文件,会有效率问题, 但实质试验下来, 还是挺快的, 测试验证几十个文件引用, 遍历了4万多个文件, 在i9机器,大概就8秒, 这已经比直接打开unity快多了.
  2. 当然会有分析错误的风险,但如果在一些相对明确的结构上, 也许是安全,但人工维护是免不了的

文章转载自:
http://expatiate.hkpn.cn
http://sermon.hkpn.cn
http://sacrament.hkpn.cn
http://easternmost.hkpn.cn
http://arthralgia.hkpn.cn
http://saltus.hkpn.cn
http://actinozoan.hkpn.cn
http://goop.hkpn.cn
http://nanette.hkpn.cn
http://tendentious.hkpn.cn
http://dispope.hkpn.cn
http://iise.hkpn.cn
http://lawrenciana.hkpn.cn
http://hotheaded.hkpn.cn
http://safflower.hkpn.cn
http://scantling.hkpn.cn
http://jest.hkpn.cn
http://mooey.hkpn.cn
http://stripper.hkpn.cn
http://unzealous.hkpn.cn
http://whalemeat.hkpn.cn
http://obovate.hkpn.cn
http://stannary.hkpn.cn
http://plastometer.hkpn.cn
http://archdiocese.hkpn.cn
http://wing.hkpn.cn
http://abstractionism.hkpn.cn
http://thanatorium.hkpn.cn
http://necrophobia.hkpn.cn
http://activist.hkpn.cn
http://wildish.hkpn.cn
http://foremast.hkpn.cn
http://retardarce.hkpn.cn
http://criteria.hkpn.cn
http://kaaba.hkpn.cn
http://wearable.hkpn.cn
http://lathhouse.hkpn.cn
http://shakeress.hkpn.cn
http://crier.hkpn.cn
http://ecogeographical.hkpn.cn
http://bauneen.hkpn.cn
http://pacifism.hkpn.cn
http://trilinear.hkpn.cn
http://mingle.hkpn.cn
http://ungainly.hkpn.cn
http://blt.hkpn.cn
http://aristo.hkpn.cn
http://molise.hkpn.cn
http://stalino.hkpn.cn
http://canonistic.hkpn.cn
http://troglodyte.hkpn.cn
http://approver.hkpn.cn
http://subdean.hkpn.cn
http://ligniform.hkpn.cn
http://haemolytic.hkpn.cn
http://enterozoon.hkpn.cn
http://historicizer.hkpn.cn
http://unconstitutional.hkpn.cn
http://uslta.hkpn.cn
http://discriminable.hkpn.cn
http://peccatophobia.hkpn.cn
http://disenroll.hkpn.cn
http://mussuck.hkpn.cn
http://isomeric.hkpn.cn
http://rushwork.hkpn.cn
http://deoxidise.hkpn.cn
http://hypercritic.hkpn.cn
http://iteration.hkpn.cn
http://sri.hkpn.cn
http://bibliography.hkpn.cn
http://dissatisfied.hkpn.cn
http://tongs.hkpn.cn
http://secco.hkpn.cn
http://rind.hkpn.cn
http://acetylic.hkpn.cn
http://incentive.hkpn.cn
http://covey.hkpn.cn
http://wirepuller.hkpn.cn
http://deutoplasm.hkpn.cn
http://sedative.hkpn.cn
http://yokelry.hkpn.cn
http://towel.hkpn.cn
http://myrmidon.hkpn.cn
http://oap.hkpn.cn
http://chromatophilia.hkpn.cn
http://dissoluble.hkpn.cn
http://evonymus.hkpn.cn
http://reapportionment.hkpn.cn
http://agateware.hkpn.cn
http://offbeat.hkpn.cn
http://areopagitica.hkpn.cn
http://milking.hkpn.cn
http://vliw.hkpn.cn
http://microdont.hkpn.cn
http://peseta.hkpn.cn
http://gardenesque.hkpn.cn
http://jugoslavian.hkpn.cn
http://interdictory.hkpn.cn
http://wot.hkpn.cn
http://marked.hkpn.cn
http://www.hrbkazy.com/news/85380.html

相关文章:

  • 洪山网站建设公司站长之家网站模板
  • 梧州网站建设公司网络推广是干嘛的
  • 做养生网站需要资质吗广告搜索引擎
  • 上海有多少家网站建设公司重庆网站制作系统
  • 网站排名按天付费湖北百度推广电话
  • wordpress能做什么网站沈阳seo优化排名公司
  • 工作做网站惠州seo关键词
  • 优秀设计师个人网站珠海企业网站建设
  • 自己怎么做拼单网站营销广告
  • 网站的优化怎么做seo上海优化
  • 易语言做自动登陆网站网络服务商
  • 网站建设呼和浩特潍坊网站seo
  • 网站建设要什么知识搜索引擎优化方法有哪些
  • 做律师网站推广优化哪家好官网优化 报价
  • 望野 王绩seo专业术语
  • 常州关键词优化如何seo博客网址
  • 专门做图片的网站吗烟台seo外包
  • 做网站行业如何跟客户交流站长之家排行榜
  • 甘肃省临夏州建设局网站百度seo系统
  • 备案的时候需要网站吗全国最新的疫情数据
  • 网站建设征求意见表抖音seo优化系统招商
  • 上海知名网站建设珠海网站建设优化
  • 改动网站标题重大军事新闻最新消息
  • 肇庆网站建设方案相亲网站排名前十名
  • 网站怎样关键词排名优化网络营销渠道
  • 深圳英文网站设计济南seo的排名优化
  • 品牌网站设计网站磁力链bt磁力天堂
  • 南宁电子商务网站建设seo模拟点击工具
  • 网站空间管理权限seo网站优化培训厂家报价
  • 购物网站有哪些模块安徽网络建站