Esempio n. 1
0
    public static void BuildAssetBundles(BuildTarget buildTarget, string channelName)
    {
        bool buildForPerChannel = PackageUtils.BuildAssetBundlesForPerChannel(buildTarget);

        XLuaMenu.CopyLuaFilesToAssetsPackage();
        PackageUtils.CheckAndRunAllCheckers(buildForPerChannel, false);

        DateTime start = DateTime.Now;

        if (buildForPerChannel)
        {
            start = DateTime.Now;
            CheckAssetBundles.SwitchChannel(channelName);
            Debug.Log("Finished CheckAssetBundles.SwitchChannel! use " + (DateTime.Now - start).TotalSeconds + "s");
        }

        start = DateTime.Now;
        InnerBuildAssetBundles(buildTarget, channelName, true);
        Debug.Log("Finished InnerBuildAssetBundles! use " + (DateTime.Now - start).TotalSeconds + "s");

        //转换wwise xml为txt
        //ConvertXml2Json(Application.dataPath + "/StreamingAssets/SoundbanksInfo.xml", Application.dataPath + "/Wwise/Resources/SoundbanksInfo.txt");

        //拷贝所有的音效资源到下载目录 转换xml为json 计算所有资源的md5值并生成尺寸文件
        PackageUtils.BuildAudioData(buildTarget, channelName);

        var targetName = PackageUtils.GetPlatformName(buildTarget);

        Debug.Log(string.Format("Build assetbundles for platform : {0} and channel : {1} done!", targetName, channelName));
    }