public string GetLogContent(TextureDetails item) { string returnValue = null; returnValue = item.objectName + " "; string sizeLabel = "" + item.textureWidth + "x" + item.textureHeight; if (item.isCubeMap) { sizeLabel += "x6"; } sizeLabel += " - " + item.mipMapCount + "mip"; sizeLabel += "\n" + FormatSizeString(item.memSizeKB) + " - " + item.format + ""; returnValue += sizeLabel; return(returnValue); }
public Dictionary <int, TextureDetails> GetNewObjectInstanceIdList(IEnumerable <Texture> scanedAllObject) { Dictionary <int, TextureDetails> returnValues = new Dictionary <int, TextureDetails>(); foreach (var newItem in scanedAllObject) { Texture tTexture = newItem as Texture; TextureDetails tTextureDetails = new TextureDetails(); tTextureDetails.isCubeMap = tTexture is Cubemap; tTextureDetails.objectName = tTexture.name; tTextureDetails.textureWidth = tTexture.width; tTextureDetails.textureHeight = tTexture.height; int memSize = tTextureDetails.CalculateTextureSizeBytes(tTexture); tTextureDetails.memSizeKB = memSize / 1024; TextureFormat tFormat = TextureFormat.RGBA32; int tMipMapCount = 1; if (tTexture is Texture2D) { tFormat = (tTexture as Texture2D).format; tMipMapCount = (tTexture as Texture2D).mipmapCount; } if (tTexture is Cubemap) { tFormat = (tTexture as Cubemap).format; } tTextureDetails.format = tFormat; tTextureDetails.mipMapCount = tMipMapCount; tTextureDetails.dublicate = false; tTextureDetails.leak = false; returnValues.Add(tTexture.GetInstanceID(), tTextureDetails); } return(returnValues); }