/// <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();
            }

            if (GUILayout.Button("AssetBundle还原目录", GUILayout.Width(380), GUILayout.Height(30)))
            {
                exportPath = EditorUtility.OpenFolderPanel("选择资源目录", Application.dataPath, "");
                if (string.IsNullOrEmpty(exportPath))
                {
                    return;
                }

                AssetBundleEditorTools.HashName2AssetName(exportPath);
            }
            GUILayout.EndVertical();
        }
示例#2
0
        /// <summary>
        /// 最新包
        /// </summary>
        void LastestGUI()
        {
            GUILayout.BeginVertical();

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


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

                RuntimePlatform rp = RuntimePlatform.Lumin;
                BuildTarget     bt = BuildTarget.Lumin;
                // if (isSelectWindows)
                // {
                //     AssetBundleEditorTools.CheackAssets(rootResourceDir,
                //                                         exportPath + "/" +
                //                                         BApplication.GetPlatformPath(RuntimePlatform.WindowsPlayer),
                //                                         BuildTarget.StandaloneWindows);
                // }

                if (isSelectAndroid)
                {
                    AssetBundleEditorTools.CheackAssets(rootResourceDir,
                                                        exportPath + "/" +
                                                        BApplication.GetPlatformPath(RuntimePlatform.Android),
                                                        BuildTarget.Android);
                }

                if (isSelectIOS)
                {
                    AssetBundleEditorTools.CheackAssets(rootResourceDir,
                                                        exportPath + "/" +
                                                        BApplication.GetPlatformPath(RuntimePlatform.IPhonePlayer),
                                                        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;
                }

                //搜集keyword
                ShaderCollection.GenShaderVariant();
                //开始打包
                BuildAsset();
            }

            if (GUILayout.Button("AssetBundle还原目录", GUILayout.Width(380), GUILayout.Height(30)))
            {
                exportPath = EditorUtility.OpenFolderPanel("选择资源目录", Application.dataPath, "");
                if (string.IsNullOrEmpty(exportPath))
                {
                    return;
                }

                AssetBundleEditorTools.HashName2AssetName(exportPath);
            }

            GUILayout.EndVertical();
        }