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);
        }
        private TextureDetails GetTextureDetail(Texture tTexture)
        {
            TextureDetails tTextureDetails = FindTextureDetails(tTexture);

            if (tTextureDetails == null)
            {
                tTextureDetails           = new TextureDetails();
                tTextureDetails.texture   = tTexture;
                tTextureDetails.isCubeMap = tTexture is Cubemap;

                int memSize = CalculateTextureSizeBytes(tTexture);

                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;
                    memSize = 8 * tTexture.height * tTexture.width;
                }
                if (tTexture is Texture2DArray)
                {
                    tFormat      = (tTexture as Texture2DArray).format;
                    tMipMapCount = 10;
                }

                tTextureDetails.memSizeKB   = memSize / 1024;
                tTextureDetails.format      = tFormat;
                tTextureDetails.mipMapCount = tMipMapCount;
            }

            return(tTextureDetails);
        }