private TextureDetails GetTextureDetail(Texture tTexture) { TextureDetails tTextureDetails = FindTextureDetails(tTexture); if (tTextureDetails == null) { tTextureDetails = new TextureDetails(); tTextureDetails.name = tTexture.name; tTextureDetails.texture = tTexture; tTextureDetails.isCubeMap = tTexture is Cubemap; int memSize = 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; } return(tTextureDetails); }
private TextureDetails GetTextureDetail(Texture tTexture, MonoBehaviour script) { TextureDetails tTextureDetails = GetTextureDetail(tTexture); tTextureDetails.FoundInScripts.Add(script); return(tTextureDetails); }
private TextureDetails GetTextureDetail(Texture tTexture, Graphic graphic) { TextureDetails tTextureDetails = GetTextureDetail(tTexture); tTextureDetails.FoundInGraphics.Add(graphic); return(tTextureDetails); }
private TextureDetails GetTextureDetail(Texture tTexture, Animator animator) { TextureDetails tTextureDetails = GetTextureDetail(tTexture); tTextureDetails.FoundInAnimators.Add(animator); return(tTextureDetails); }
private TextureDetails GetTextureDetail(Texture tTexture, Renderer renderer) { TextureDetails tTextureDetails = GetTextureDetail(tTexture); tTextureDetails.FoundInRenderers.Add(renderer); return(tTextureDetails); }
private TextureDetails GetTextureDetail(Texture tTexture, Material tMaterial, MaterialDetails tMaterialDetails) { TextureDetails tTextureDetails = GetTextureDetail(tTexture); tTextureDetails.FoundInMaterials.Add(tMaterial); foreach (Renderer renderer in tMaterialDetails.FoundInRenderers) { if (!tTextureDetails.FoundInRenderers.Contains(renderer)) { tTextureDetails.FoundInRenderers.Add(renderer); } } return(tTextureDetails); }