示例#1
0
    /// <summary>
    /// 一键打包
    /// </summary>
    public void BuildAssetBundleTotal(bool showTip, BuildABType buildABType = BuildABType.None)
    {
        IEnumerator etor = DoBuild(showTip, buildABType);

        while (etor.MoveNext())
        {
            Debug.Log(etor.Current);
        }
    }
示例#2
0
    IEnumerator DoBuild(bool showTip, BuildABType buildABType = BuildABType.None)
    {
        if (showTip)
        {
            if (!EditorUtility.DisplayDialog("一键打包工具", "确定执行吗?", "执行"))
            {
                yield break;
            }
        }

        string errMsg;

        if (!CheckCanBuild(out errMsg))
        {
            if (showTip)
            {
                EditorUtility.DisplayDialog("错误", errMsg, "好的");
            }
            yield break;
        }
        //当前工程Build平台
        BuildAssetBundleOptions options = BuildAssetBundleOptions.None;

        //开始打包
        switch (buildABType)
        {
        case BuildABType.None:
            break;

        case BuildABType.Atlas:
            BuildAB("ui/uiatlas", options, EditorPrefsHelper.CurBuildTarget);
            break;

        case BuildABType.UIPrefab:

            break;

        case BuildABType.Table:
            BuildAB("table", options, EditorPrefsHelper.CurBuildTarget);
            break;

        case BuildABType.All:

            BuildAssetBundleTotal(false, BuildABType.Atlas);
            BuildAssetBundleTotal(false, BuildABType.UIPrefab);
            BuildAssetBundleTotal(false, BuildABType.Table);
            break;

        default:
            break;
        }



        //BuildPipeline.BuildAssetBundles(Application.streamingAssetsPath, options, activeTarget);
    }