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));
    }
Esempio n. 2
0
    public static void BuildAssetBundlesForAllChannels(BuildTarget buildTarget)
    {
        bool buildForPerChannel = PackageUtils.BuildAssetBundlesForPerChannel(buildTarget);
        var  targetName         = PackageUtils.GetPlatformName(buildTarget);

        Debug.Assert(buildForPerChannel == true);

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

        int    index             = 0;
        double switchChannel     = 0;
        double buildAssetbundles = 0;
        var    start             = DateTime.Now;

        foreach (var current in (ChannelType[])Enum.GetValues(typeof(ChannelType)))
        {
            var channelName = current.ToString();

            start = DateTime.Now;
            CheckAssetBundles.SwitchChannel(channelName);
            switchChannel = (DateTime.Now - start).TotalSeconds;

            start = DateTime.Now;
            InnerBuildAssetBundles(buildTarget, channelName, index == 0);
            buildAssetbundles = (DateTime.Now - start).TotalSeconds;

            index++;
            Debug.Log(string.Format("{0}.Build assetbundles for platform : {1} and channel : {2} done! use time : switchChannel = {3}s , build assetbundls = {4} s", index, targetName, channelName, switchChannel, buildAssetbundles));
        }

        Debug.Log(string.Format("Build assetbundles for platform : {0} for all {1} channels done!", targetName, index));
    }
Esempio n. 3
0
    public static void Run()
    {
        XLuaMenu.CopyLuaFilesToAssetsPackage();

        ClearAllAssetBundles();
        RunAllCheckers();
    }
Esempio n. 4
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");

        var targetName = PackageUtils.GetPlatformName(buildTarget);

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