Ejemplo n.º 1
0
    public void CreateSdkPrefab(EPlatform type)
    {
        //测试
        Debugger.Log("CreateSdkPrefab " + type.ToString());

        sdkType = type;
        if (type == EPlatform.ePlatform_None)
        {
            return;
        }
        CreateSdk(sdkPath);
    }
Ejemplo n.º 2
0
        private void InnerScanTex(Texture tex, string texPath)
        {
            AssetImporter   assetImport = AssetImporter.GetAtPath(texPath);
            TextureImporter texImport   = assetImport as TextureImporter;

            if (texImport == null)
            {
                XDebug.LogError(texPath);
                return;
            }
            int texSize = 0;
            TextureImporterFormat format;

            texImport.GetPlatformTextureSettings(m_Platform.ToString(), out texSize, out format);
            long sizePer32 = 1;

            switch (format)
            {
            case TextureImporterFormat.ETC_RGB4:
                sizePer32 = 1;
                break;

            case TextureImporterFormat.RGB24:
                sizePer32 = 6;
                break;

            case TextureImporterFormat.RGBA16:
                sizePer32 = 4;
                break;

            case TextureImporterFormat.RGBA32:
                sizePer32 = 8;
                break;

            case TextureImporterFormat.Alpha8:
                sizePer32 = 2;
                break;
            }
            long    size      = tex.width * tex.height * sizePer32 / 2;
            string  sizeStr   = string.Format("{0}x{0}", tex.width, tex.height);
            string  formatStr = format.ToString();
            TexInfo ti        = null;

            if (!m_FormatMap.TryGetValue(formatStr, out ti))
            {
                ti = new TexInfo();
                m_FormatMap.Add(formatStr, ti);
            }
            ti.texList.Add(tex);
            ti.size += size;

            ti = null;
            if (!m_SizeMap.TryGetValue(sizeStr, out ti))
            {
                ti = new TexInfo();
                m_SizeMap.Add(sizeStr, ti);
            }
            ti.texList.Add(tex);
            ti.size     += size;
            m_TotalSize += size;
            m_TotalCount++;
        }