Пример #1
0
    /// <summary>
    /// 最新包
    /// </summary>
    void LastestGUI()
    {
        GUILayout.BeginVertical();

        if (GUILayout.Button("检测资源", GUILayout.Width(100)))
        {
            exportPath = EditorUtility.OpenFolderPanel("选择导出目录", Application.dataPath, "");


            if (string.IsNullOrEmpty(exportPath))
            {
                return;
            }

            if (isSelectWindows)
            {
                AssetBundleEditorTools.CheackAssets(rootResourceDir, exportPath + "/Windows", BuildTarget.StandaloneWindows);
            }
            if (isSelectAndroid)
            {
                AssetBundleEditorTools.CheackAssets(rootResourceDir, exportPath + "/Android", BuildTarget.Android);
            }
            if (isSelectIOS)
            {
                AssetBundleEditorTools.CheackAssets(rootResourceDir, exportPath + "/iOS", BuildTarget.iOS);
            }

            AssetDatabase.Refresh();
            Debug.Log("资源打包完毕");
        }

        if (GUILayout.Button("一键打包[美术资源]", GUILayout.Width(380), GUILayout.Height(30)))
        {
            var exportPath = EditorUtility.OpenFolderPanel("选择导出目录", Application.dataPath, "");
            if (string.IsNullOrEmpty(exportPath))
            {
                return;
            }
            //开始打包
            if (isSelectWindows)
            {
                AssetBundleEditorTools.GenAssetBundle(rootResourceDir, exportPath + "/Windows", BuildTarget.StandaloneWindows, options);
            }
            if (isSelectAndroid)
            {
                AssetBundleEditorTools.GenAssetBundle(rootResourceDir, exportPath + "/Android", BuildTarget.Android, options);
            }
            if (isSelectIOS)
            {
                AssetBundleEditorTools.GenAssetBundle(rootResourceDir, exportPath + "/iOS", BuildTarget.iOS, options);
            }

            AssetDatabase.Refresh();
            Debug.Log("资源打包完毕");
        }

        GUILayout.EndVertical();
    }
Пример #2
0
    /// <summary>
    /// 最新包
    /// </summary>
    void LastestGUI()
    {
        GUILayout.BeginVertical();

        if (GUILayout.Button("检测资源", GUILayout.Width(100)))
        {
            if (isSelectWindows)
            {
                AssetBundleEditorTools.CheackAssets(rootResourceDir, Application.streamingAssetsPath + "/Windows", BuildTarget.StandaloneWindows);
            }
            if (isSelectAndroid)
            {
                AssetBundleEditorTools.CheackAssets(rootResourceDir, Application.streamingAssetsPath + "/Android", BuildTarget.Android);
            }
            if (isSelectIOS)
            {
                AssetBundleEditorTools.CheackAssets(rootResourceDir, Application.streamingAssetsPath + "/iOS", BuildTarget.iOS);
            }

            AssetDatabase.Refresh();
            Debug.Log("资源打包完毕");
        }

        if (GUILayout.Button("一键打包[美术资源]", GUILayout.Width(380), GUILayout.Height(30)))
        {
            //开始打包
            if (isSelectWindows)
            {
                AssetBundleEditorTools.GenAssetBundle(rootResourceDir, Application.streamingAssetsPath + "/Windows", BuildTarget.StandaloneWindows);
            }
            if (isSelectAndroid)
            {
                AssetBundleEditorTools.GenAssetBundle(rootResourceDir, Application.streamingAssetsPath + "/Android", BuildTarget.Android);
            }
            if (isSelectIOS)
            {
                AssetBundleEditorTools.GenAssetBundle(rootResourceDir, Application.streamingAssetsPath + "/iOS", BuildTarget.iOS);
            }

            AssetDatabase.Refresh();
            Debug.Log("资源打包完毕");
        }

        GUILayout.EndVertical();
    }
Пример #3
0
    /// <summary>
    /// 最新包
    /// </summary>
    void LastestGUI()
    {
        GUILayout.BeginVertical();

        if (GUILayout.Button("检测资源", GUILayout.Width(100)))
        {
            exportPath = EditorUtility.OpenFolderPanel("选择导出目录", Application.dataPath, "");


            if (string.IsNullOrEmpty(exportPath))
            {
                return;
            }

            if (isSelectAndroid)
            {
                AssetBundleEditorTools.CheackAssets(rootResourceDir, exportPath + "/Android", BuildTarget.Android);
            }
            if (isSelectIOS)
            {
                AssetBundleEditorTools.CheackAssets(rootResourceDir, exportPath + "/iOS", BuildTarget.iOS);
            }

            AssetDatabase.Refresh();
            Debug.Log("资源打包完毕");
        }

        if (GUILayout.Button("收集Shader keyword", GUILayout.Width(200)))
        {
            ShaderCollection.GenShaderVariant();
        }

        if (GUILayout.Button("一键打包[美术资源]", GUILayout.Width(380), GUILayout.Height(30)))
        {
            exportPath = EditorUtility.OpenFolderPanel("选择导出目录", Application.dataPath, "");
            if (string.IsNullOrEmpty(exportPath))
            {
                return;
            }
            //开始打包
            BuildAsset();
        }

        GUILayout.EndVertical();
    }