三国卡牌客户端基础资源仓库
yyl
2026-05-11 195fe0ce2ef62facaa5bf836ebdf8866984e84a1
Assets/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs
@@ -90,6 +90,12 @@
            set { LocalSave.SetString("APKOutPutPath", value); }
        }
        public string AndroidExportPath
        {
            get { return LocalSave.GetString("AndroidExportPath"); }
            set { LocalSave.SetString("AndroidExportPath", value); }
        }
        string m_Publishers;
        public string publishers
        {
@@ -230,6 +236,15 @@
            var fromVersionConfig = ClientPackage.GetVersionConfig(_publisher, out versionName);
            var versionConfig = await VersionConfig.GetAsync();
            if (fromVersionConfig == null || versionConfig == null)
            {
                Debug.LogWarningFormat("SetVersionConfig failed: fromVersionConfig={0}, versionConfig={1}, publisher={2}",
                    fromVersionConfig != null ? "ok" : "null",
                    versionConfig != null ? "ok" : "null",
                    _publisher);
                return;
            }
            VersionConfig.Copy(fromVersionConfig, versionConfig);
@@ -516,6 +531,32 @@
#endif
            GUILayout.EndHorizontal();
#if UNITY_ANDROID
            EditorGUILayout.Space();
            GUILayout.Label("Export Android Project", EditorStyles.boldLabel);
            GUILayout.BeginHorizontal();
            var newExportPath = EditorGUILayout.TextField("Export Path", AndroidExportPath);
            if (!string.IsNullOrEmpty(newExportPath) && newExportPath != AndroidExportPath)
            {
                AndroidExportPath = newExportPath;
            }
            if (GUILayout.Button("Browse", GUILayout.MaxWidth(75f)))
            {
                BrowseForAndroidExport();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Export Android Project"))
            {
                EditorApplication.delayCall += ExecuteExportAndroidProject;
            }
            if (GUILayout.Button("Export Android Dev"))
            {
                EditorApplication.delayCall += ExecuteExportAndroidProjectDev;
            }
            GUILayout.EndHorizontal();
#endif
            // GUILayout.Space(20);
            // if (GUILayout.Button("SwitchVersionConfig"))
@@ -966,6 +1007,30 @@
            ClientPackage.BuildPublishers(ClientPackage.SDK_PLUGIN_PROJECT, outputPath, ApkOutputPath, publishers, packageIndex, true, false);
        }
        private void ExecuteExportAndroidProject()
        {
            if (string.IsNullOrEmpty(AndroidExportPath))
            {
                EditorUtility.DisplayDialog("提示", "请先设置 Android Export Path", "确定");
                return;
            }
            packageIndex++;
            var assetBundlePath = Application.dataPath.Replace("Assets", m_UserData.m_OutputPath);
            ClientPackage.ExportAndroidProject(publishers, packageIndex, false, AndroidExportPath, assetBundlePath);
        }
        private void ExecuteExportAndroidProjectDev()
        {
            if (string.IsNullOrEmpty(AndroidExportPath))
            {
                EditorUtility.DisplayDialog("提示", "请先设置 Android Export Path", "确定");
                return;
            }
            packageIndex++;
            var assetBundlePath = Application.dataPath.Replace("Assets", m_UserData.m_OutputPath);
            ClientPackage.ExportAndroidProject(publishers, packageIndex, true, AndroidExportPath, assetBundlePath);
        }
        private void ExecuteBuildClientPackageStandalone()
        {
            packageIndex++;
@@ -1084,6 +1149,15 @@
            }
        }
        private void BrowseForAndroidExport()
        {
            var newPath = EditorUtility.OpenFolderPanel("Android Export Folder", AndroidExportPath, string.Empty);
            if (!string.IsNullOrEmpty(newPath))
            {
                AndroidExportPath = newPath;
            }
        }
        private void ResetPathToDefault()
        {
            m_UserData.m_UseDefaultPath = true;