public JsonTexture(Texture tex, ResourceMapper resMap)
        {
            name = tex.name;
            id   = resMap.findTextureId(tex);          //exp.textures.findId(tex);
            var assetPath = AssetDatabase.GetAssetPath(tex);

            resMap.registerAssetPath(assetPath);
            path       = assetPath;
            filterMode = tex.filterMode.ToString();
            width      = tex.width;
            height     = tex.height;
            wrapMode   = tex.wrapMode.ToString();
            var tex2D      = tex as Texture2D;
            var rendTarget = tex as RenderTexture;

            isTex2D        = tex2D != null;
            isRenderTarget = rendTarget != null;
            var importer    = AssetImporter.GetAtPath(assetPath);
            var texImporter = importer as TextureImporter;            //(TextureImporter)importer;

            if (isTex2D)
            {
                alphaTransparency = tex2D.alphaIsTransparency;
                format            = tex2D.format.ToString();
            }
            if (isRenderTarget)
            {
                anisoLevel = rendTarget.anisoLevel;
            }
            if (texImporter)
            {
                importDataFound = true;
                sRGB            = texImporter.sRGBTexture;
                textureType     = texImporter.textureType.ToString();
                normalMapFlag   = (texImporter.textureType == TextureImporterType.NormalMap);
            }

            texParams       = new JsonTextureParameters(tex);
            texImportParams = new JsonTextureImportParameters(texImporter);

            textureRef = tex;
        }
        public JsonCubemap(Cubemap cubemap_, ResourceMapper resMap)
        {
            cubemap = cubemap_;
            if (!cubemap)
            {
                return;
            }
            id        = resMap.findCubemapId(cubemap);
            assetPath = AssetDatabase.GetAssetPath(cubemap);
            name      = cubemap.name;

            var importer    = AssetImporter.GetAtPath(assetPath);
            var texImporter = importer as TextureImporter;

            texParams       = new JsonTextureParameters(cubemap);
            texImportParams = new JsonTextureImportParameters(texImporter);

            needConversion = true;

            /*
             * if (TextureUtility.isSupportedTexExtension(assetPath))
             *      needConversion = true;
             * if (texImportParams.initialized && texImportParams.importer){
             *      if (texImportParams.importer.generateCubemap != TextureImporterGenerateCubemap.FullCubemap){
             *              needConversion = true;
             *      }
             *      //huh.... I don't really have a way to get original texture dimensiosn, it looks like it. Oh well?
             * }
             */

            format = cubemap.format.ToString();
            isHdr  = TextureUtility.isHdrFormat(cubemap.format);

            exportPath = assetPath;
            rawPath    = "";
            if (needConversion)
            {
                exportPath = System.IO.Path.ChangeExtension(assetPath, ".png");
                rawPath    = System.IO.Path.ChangeExtension(assetPath, ".raw");
            }
        }