// 返回值是对象在ShaderGUIDInfo数组中的索引, 没找到时返回-1 // private static int LineContainsGUID(string line, ShaderGUIDInfo[] guidInfos) { if (string.IsNullOrEmpty(line) || guidInfos == null || guidInfos.Length == 0) { return(-1); } for (int i = 0; i < guidInfos.Length; i++) { ShaderGUIDInfo guidInfo = guidInfos[i]; if (guidInfo != null && line.Contains(guidInfo.guid)) { return(i); } } return(-1); }
private static ShaderGUIDInfo[] GetAthenaShaderGUIdList(Shader[] shaders) { if (shaders == null || shaders.Length == 0) { return(null); } int shaderCount = shaders.Length; ShaderGUIDInfo[] result = new ShaderGUIDInfo[shaderCount]; for (int i = 0; i < shaderCount; i++) { Shader shader = shaders[i]; ShaderGUIDInfo guidInfo = new ShaderGUIDInfo(); guidInfo.shader = shader; // guidInfo.guid = GetShaderGUID(shader); guidInfo.guid = GetShaderGUID2(shader); result[i] = guidInfo; } return(result); }