public override string GetInfoString() { Texture texture = base.target as Texture; string str = texture.width.ToString() + "x" + texture.height.ToString(); TextureFormat textureFormat = TextureUtil.GetTextureFormat(texture); return(str + " " + TextureUtil.GetTextureFormatString(textureFormat)); }
public override string GetInfoString() { Texture t = target as Texture; string info = t.width.ToString() + "x" + t.height.ToString(); TextureFormat format = TextureUtil.GetTextureFormat(t); info += " " + TextureUtil.GetTextureFormatString(format); return(info); }
public override string GetInfoString() { Texture3D tex = target as Texture3D; var format = TextureUtil.GetTextureFormatString(tex.format); var size = EditorUtility.FormatBytes(TextureUtil.GetRuntimeMemorySizeLong(tex)); string info = $"{tex.width}x{tex.height}x{tex.depth} {format} {size}"; return(info); }
private static string[] BuildTextureStrings(int[] texFormatValues) { string[] retval = new string[texFormatValues.Length]; for (int i = 0; i < texFormatValues.Length; i++) { int val = texFormatValues[i]; retval[i] = (val < 0 ? "Automatic" : TextureUtil.GetTextureFormatString((TextureFormat)val)); } return(retval); }
public override string GetInfoString() { Texture3D tex = target as Texture3D; string info = UnityString.Format("{0}x{1}x{2} {3} {4}", tex.width, tex.height, tex.depth, TextureUtil.GetTextureFormatString(tex.format), EditorUtility.FormatBytes(TextureUtil.GetRuntimeMemorySizeLong(tex))); return(info); }
public override string GetInfoString() { Texture2DArray tex = (Texture2DArray)target; string info = UnityString.Format("{0}x{1} {2} slice{5} {3} {4}", tex.width, tex.height, tex.depth, TextureUtil.GetTextureFormatString(tex.format), EditorUtility.FormatBytes(TextureUtil.GetRuntimeMemorySizeLong(tex)), tex.depth != 1 ? "s" : ""); return(info); }
public override string GetInfoString() { Texture3D texture3D = base.target as Texture3D; return(string.Format("{0}x{1}x{2} {3} {4}", new object[] { texture3D.width, texture3D.height, texture3D.depth, TextureUtil.GetTextureFormatString(texture3D.format), EditorUtility.FormatBytes(TextureUtil.GetRuntimeMemorySizeLong(texture3D)) })); }
public override string GetInfoString() { Texture texture = base.target as Texture; Texture2D texture2D = base.target as Texture2D; TextureImporter textureImporter = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(texture)) as TextureImporter; string text = texture.width.ToString() + "x" + texture.height.ToString(); if (QualitySettings.desiredColorSpace == ColorSpace.Linear) { text = text + " " + TextureUtil.GetTextureColorSpaceString(texture); } bool flag = textureImporter && textureImporter.qualifiesForSpritePacking; bool flag2 = TextureInspector.IsNormalMap(texture); bool flag3 = TextureUtil.DoesTextureStillNeedToBeCompressed(AssetDatabase.GetAssetPath(texture)); bool flag4 = texture2D != null && TextureUtil.IsNonPowerOfTwo(texture2D); TextureFormat textureFormat = TextureUtil.GetTextureFormat(texture); bool flag5 = !flag3; if (flag4) { text += " (NPOT)"; } if (flag3) { text += " (Not yet compressed)"; } else if (flag2) { switch (textureFormat) { case TextureFormat.ARGB4444: text += " Nm 16 bit"; goto IL_176; case TextureFormat.RGB24: IL_11D: if (textureFormat != TextureFormat.DXT5) { text = text + " " + TextureUtil.GetTextureFormatString(textureFormat); goto IL_176; } text += " DXTnm"; goto IL_176; case TextureFormat.RGBA32: case TextureFormat.ARGB32: text += " Nm 32 bit"; goto IL_176; } goto IL_11D; IL_176 :; } else if (flag) { TextureFormat format; ColorSpace colorSpace; int num; textureImporter.ReadTextureImportInstructions(EditorUserBuildSettings.activeBuildTarget, out format, out colorSpace, out num); string text2 = text; text = string.Concat(new string[] { text2, "\n ", TextureUtil.GetTextureFormatString(textureFormat), "(Original) ", TextureUtil.GetTextureFormatString(format), "(Atlas)" }); } else { text = text + " " + TextureUtil.GetTextureFormatString(textureFormat); } if (flag5) { text = text + "\n" + EditorUtility.FormatBytes(TextureUtil.GetStorageMemorySizeLong(texture)); } if (TextureUtil.GetUsageMode(texture) == TextureUsageMode.AlwaysPadded) { int gPUWidth = TextureUtil.GetGPUWidth(texture); int gPUHeight = TextureUtil.GetGPUHeight(texture); if (texture.width != gPUWidth || texture.height != gPUHeight) { text += string.Format("\nPadded to {0}x{1}", gPUWidth, gPUHeight); } } return(text); }
public override string GetInfoString() { Texture target = base.target as Texture; Texture2D t = base.target as Texture2D; TextureImporter atPath = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(target)) as TextureImporter; string str = target.width.ToString() + "x" + target.height.ToString(); if (QualitySettings.desiredColorSpace == ColorSpace.Linear) { str = str + " " + TextureUtil.GetTextureColorSpaceString(target); } bool flag = true; bool flag2 = (atPath != null) && atPath.qualifiesForSpritePacking; bool flag3 = IsNormalMap(target); bool flag4 = TextureUtil.DoesTextureStillNeedToBeCompressed(AssetDatabase.GetAssetPath(target)); bool flag5 = (t != null) && TextureUtil.IsNonPowerOfTwo(t); TextureFormat textureFormat = TextureUtil.GetTextureFormat(target); flag = !flag4; if (flag5) { str = str + " (NPOT)"; } if (flag4) { str = str + " (Not yet compressed)"; } else if (!flag3) { if (flag2) { TextureFormat format2; ColorSpace space; int num3; atPath.ReadTextureImportInstructions(EditorUserBuildSettings.activeBuildTarget, out format2, out space, out num3); string str2 = str; string[] textArray1 = new string[] { str2, "\n ", TextureUtil.GetTextureFormatString(textureFormat), "(Original) ", TextureUtil.GetTextureFormatString(format2), "(Atlas)" }; str = string.Concat(textArray1); } else { str = str + " " + TextureUtil.GetTextureFormatString(textureFormat); } } else { switch (textureFormat) { case TextureFormat.ARGB4444: str = str + " Nm 16 bit"; goto Label_01EF; case TextureFormat.RGBA32: case TextureFormat.ARGB32: str = str + " Nm 32 bit"; goto Label_01EF; } if (textureFormat == TextureFormat.DXT5) { str = str + " DXTnm"; } else { str = str + " " + TextureUtil.GetTextureFormatString(textureFormat); } } Label_01EF: if (flag) { str = str + "\n" + EditorUtility.FormatBytes(TextureUtil.GetStorageMemorySize(target)); } if (TextureUtil.GetUsageMode(target) != TextureUsageMode.AlwaysPadded) { return(str); } int gPUWidth = TextureUtil.GetGPUWidth(target); int gPUHeight = TextureUtil.GetGPUHeight(target); if ((target.width == gPUWidth) && (target.height == gPUHeight)) { return(str); } return(str + $" Padded to {gPUWidth}x{gPUHeight}"); }
public override string GetInfoString() { // TextureInspector code is reused for RenderTexture and Cubemap inspectors. // Make sure we can handle the situation where target is just a Texture and // not a Texture2D. Texture t = target as Texture; Texture2D t2 = target as Texture2D; TextureImporter textureImporter = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(t)) as TextureImporter; string info = t.width + "x" + t.height; bool showSize = true; bool isPackedSprite = textureImporter && textureImporter.qualifiesForSpritePacking; bool isNormalmap = IsNormalMap(t); bool stillNeedsCompression = TextureUtil.DoesTextureStillNeedToBeCompressed(AssetDatabase.GetAssetPath(t)); bool isNPOT = t2 != null && TextureUtil.IsNonPowerOfTwo(t2); GraphicsFormat format = t.graphicsFormat; showSize = !stillNeedsCompression; if (isNPOT) { info += " (NPOT)"; } if (stillNeedsCompression) { info += " (Not yet compressed)"; } else { if (isNormalmap) { switch (format) { case GraphicsFormat.RGBA_DXT5_SRGB: case GraphicsFormat.RGBA_DXT5_UNorm: info += " DXTnm"; break; case GraphicsFormat.R8G8B8A8_SRGB: case GraphicsFormat.R8G8B8A8_UNorm: case GraphicsFormat.B8G8R8A8_SRGB: case GraphicsFormat.B8G8R8A8_UNorm: info += " Nm 32 bit"; break; case GraphicsFormat.R4G4B4A4_UNormPack16: case GraphicsFormat.B4G4R4A4_UNormPack16: info += " Nm 16 bit"; break; default: info += " " + GraphicsFormatUtility.GetFormatString(format); break; } } else if (isPackedSprite) { TextureFormat desiredFormat; ColorSpace dummyColorSpace; int dummyComressionQuality; textureImporter.ReadTextureImportInstructions(EditorUserBuildSettings.activeBuildTarget, out desiredFormat, out dummyColorSpace, out dummyComressionQuality); info += "\n " + GraphicsFormatUtility.GetFormatString(format) + "(Original) " + TextureUtil.GetTextureFormatString(desiredFormat) + "(Atlas)"; } else { info += " " + GraphicsFormatUtility.GetFormatString(format); } } if (showSize) { info += "\n" + EditorUtility.FormatBytes(TextureUtil.GetStorageMemorySizeLong(t)); } if (TextureUtil.GetUsageMode(t) == TextureUsageMode.AlwaysPadded) { var glWidth = TextureUtil.GetGPUWidth(t); var glHeight = TextureUtil.GetGPUHeight(t); if (t.width != glWidth || t.height != glHeight) { info += UnityString.Format("\nPadded to {0}x{1}", glWidth, glHeight); } } else if (TextureUtil.GetUsageMode(t) == TextureUsageMode.BakedLightmapRGBM || TextureUtil.GetUsageMode(t) == TextureUsageMode.RealtimeLightmapRGBM || TextureUtil.GetUsageMode(t) == TextureUsageMode.RGBMEncoded) { info += "\nRGBM encoded"; } else if (TextureUtil.GetUsageMode(t) == TextureUsageMode.DoubleLDR || TextureUtil.GetUsageMode(t) == TextureUsageMode.BakedLightmapDoubleLDR) { info += "\ndLDR encoded"; } return(info); }
public override string GetInfoString() { Texture texture = this.target as Texture; Texture2D texture2D = this.target as Texture2D; string text = texture.width.ToString() + "x" + texture.height.ToString(); if (QualitySettings.desiredColorSpace == ColorSpace.Linear) { text = text + " " + TextureUtil.GetTextureColorSpaceString(texture); } bool flag = TextureInspector.IsNormalMap(texture); bool flag2 = TextureUtil.DoesTextureStillNeedToBeCompressed(AssetDatabase.GetAssetPath(texture)); bool flag3 = texture2D != null && TextureUtil.IsNonPowerOfTwo(texture2D); TextureFormat textureFormat = TextureUtil.GetTextureFormat(texture); bool flag4 = !flag2; if (flag3) { text += " (NPOT)"; } if (flag2) { text += " (Not yet compressed)"; } else { if (flag) { TextureFormat textureFormat2 = textureFormat; switch (textureFormat2) { case TextureFormat.ARGB4444: text += " Nm 16 bit"; goto IL_142; case TextureFormat.RGB24: case TextureFormat.RGBA32: IL_E9: if (textureFormat2 != TextureFormat.DXT5) { text = text + " " + TextureUtil.GetTextureFormatString(textureFormat); goto IL_142; } text += " DXTnm"; goto IL_142; case TextureFormat.ARGB32: text += " Nm 32 bit"; goto IL_142; } goto IL_E9; IL_142 :; } else { text = text + " " + TextureUtil.GetTextureFormatString(textureFormat); } } if (flag4) { text = text + "\n" + EditorUtility.FormatBytes(TextureUtil.GetStorageMemorySize(texture)); } if (TextureUtil.GetUsageMode(texture) == TextureUsageMode.AlwaysPadded) { int gLWidth = TextureUtil.GetGLWidth(texture); int gLHeight = TextureUtil.GetGLHeight(texture); if (texture.width != gLWidth || texture.height != gLHeight) { text += string.Format("\nPadded to {0}x{1}", gLWidth, gLHeight); } } return(text); }
public override string GetInfoString() { Texture target1 = this.target as Texture; Texture2D target2 = this.target as Texture2D; TextureImporter atPath = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath((UnityEngine.Object)target1)) as TextureImporter; string str1 = target1.width.ToString() + "x" + target1.height.ToString(); if (QualitySettings.desiredColorSpace == ColorSpace.Linear) { str1 = str1 + " " + TextureUtil.GetTextureColorSpaceString(target1); } bool flag1 = (bool)((UnityEngine.Object)atPath) && atPath.qualifiesForSpritePacking; bool flag2 = TextureInspector.IsNormalMap(target1); bool beCompressed = TextureUtil.DoesTextureStillNeedToBeCompressed(AssetDatabase.GetAssetPath((UnityEngine.Object)target1)); bool flag3 = (UnityEngine.Object)target2 != (UnityEngine.Object)null && TextureUtil.IsNonPowerOfTwo(target2); TextureFormat textureFormat1 = TextureUtil.GetTextureFormat(target1); bool flag4 = !beCompressed; if (flag3) { str1 += " (NPOT)"; } string str2; if (beCompressed) { str2 = str1 + " (Not yet compressed)"; } else if (flag2) { TextureFormat textureFormat2 = textureFormat1; switch (textureFormat2) { case TextureFormat.ARGB4444: str2 = str1 + " Nm 16 bit"; break; case TextureFormat.ARGB32: str2 = str1 + " Nm 32 bit"; break; default: str2 = textureFormat2 == TextureFormat.DXT5 ? str1 + " DXTnm" : str1 + " " + TextureUtil.GetTextureFormatString(textureFormat1); break; } } else if (flag1) { TextureFormat desiredFormat; ColorSpace colorSpace; int compressionQuality; atPath.ReadTextureImportInstructions(EditorUserBuildSettings.activeBuildTarget, out desiredFormat, out colorSpace, out compressionQuality); str2 = str1 + "\n " + TextureUtil.GetTextureFormatString(textureFormat1) + "(Original) " + TextureUtil.GetTextureFormatString(desiredFormat) + "(Atlas)"; } else { str2 = str1 + " " + TextureUtil.GetTextureFormatString(textureFormat1); } if (flag4) { str2 = str2 + "\n" + EditorUtility.FormatBytes(TextureUtil.GetStorageMemorySize(target1)); } if (TextureUtil.GetUsageMode(target1) == TextureUsageMode.AlwaysPadded) { int glWidth = TextureUtil.GetGLWidth(target1); int glHeight = TextureUtil.GetGLHeight(target1); if (target1.width != glWidth || target1.height != glHeight) { str2 += string.Format("\nPadded to {0}x{1}", (object)glWidth, (object)glHeight); } } return(str2); }
public override string GetInfoString() { Texture target = this.target as Texture; return(target.width.ToString() + "x" + target.height.ToString() + " " + TextureUtil.GetTextureFormatString(TextureUtil.GetTextureFormat(target))); }
public override string GetInfoString() { Texture3D target = base.target as Texture3D; return($"{target.width}x{target.height}x{target.depth} {TextureUtil.GetTextureFormatString(target.format)} {EditorUtility.FormatBytes(TextureUtil.GetRuntimeMemorySize(target))}"); }
public override string GetInfoString() { var tex = (Texture2DArray)target; var info = $"{tex.width}x{tex.height} {tex.depth} slice{(tex.depth != 1 ? "s" : "")} {TextureUtil.GetTextureFormatString(tex.format)} {EditorUtility.FormatBytes(TextureUtil.GetRuntimeMemorySizeLong(tex))}"; return(info); }
public override string GetInfoString() { Texture3D target = this.target as Texture3D; return(string.Format("{0}x{1}x{2} {3} {4}", (object)target.width, (object)target.height, (object)target.depth, (object)TextureUtil.GetTextureFormatString(target.format), (object)EditorUtility.FormatBytes(TextureUtil.GetRuntimeMemorySize((Texture)target)))); }
public override string GetInfoString() { Texture3D target = this.target as Texture3D; object[] args = new object[] { target.width, target.height, target.depth, TextureUtil.GetTextureFormatString(target.format), EditorUtility.FormatBytes(TextureUtil.GetRuntimeMemorySize(target)) }; return(string.Format("{0}x{1}x{2} {3} {4}", args)); }