diff --git a/Assets/00.StaryEvo/Editor/Build/BuildApkWindow.cs b/Assets/00.StaryEvo/Editor/Build/BuildApkWindow.cs index cec020a..d752a1c 100644 --- a/Assets/00.StaryEvo/Editor/Build/BuildApkWindow.cs +++ b/Assets/00.StaryEvo/Editor/Build/BuildApkWindow.cs @@ -83,18 +83,32 @@ public class BuildApkWindow : OdinEditorWindow if (hotfixMainResDomain == null) { Debug.LogError("HotfixMainResDomain 资源在Resources下不存在,请检查!"); + return; } + if (hotfixMainResDomain.projectInfo.loadingScene == null) + { + Debug.LogError("HotfixMainResDomain 资源中loadingScene索引不存在,请检查!"); + return; + } // 设置包名和项目名 PlayerSettings.productName = hotfixMainResDomain.projectInfo.projectName; PlayerSettings.applicationIdentifier = hotfixMainResDomain.projectInfo.projectPackageName; + // 获取loadingScene的Assets相对路径 + string loadingScenePath = AssetDatabase.GetAssetPath(hotfixMainResDomain.projectInfo.loadingScene); + if (string.IsNullOrEmpty(loadingScenePath)) + { + Debug.LogError("LoadingScene路径获取失败,请检查场景资源设置"); + return; + } + // 配置构建选项 BuildPlayerOptions buildOptions = new BuildPlayerOptions { scenes = new[] { - $"Assets/SplashScreen/EvoScenes/loading.unity", + $"{loadingScenePath}", $"Assets/Main/main_{deviceType.ToString()}.unity" }, locationPathName = $"Builds/Android/{PlayerSettings.applicationIdentifier}.apk", diff --git a/Assets/00.StaryEvo/Runtime/PlayerSettings/HotfixMainResDomain.cs b/Assets/00.StaryEvo/Runtime/PlayerSettings/HotfixMainResDomain.cs index 4bf3029..b974eaa 100644 --- a/Assets/00.StaryEvo/Runtime/PlayerSettings/HotfixMainResDomain.cs +++ b/Assets/00.StaryEvo/Runtime/PlayerSettings/HotfixMainResDomain.cs @@ -1,5 +1,6 @@ using System; using Sirenix.OdinInspector; +using UnityEditor; using UnityEngine; namespace Stary.Evo @@ -36,5 +37,9 @@ namespace Stary.Evo /// [ReadOnly] public string projectPackageName; + + + public SceneAsset loadingScene; + } } \ No newline at end of file diff --git a/Assets/00.StaryEvo/package.json b/Assets/00.StaryEvo/package.json index 0014a45..04ff1c3 100644 --- a/Assets/00.StaryEvo/package.json +++ b/Assets/00.StaryEvo/package.json @@ -1,6 +1,6 @@ { "name": "com.staryevo.main", - "version": "1.3.10", + "version": "1.3.11", "displayName": "00.StaryEvo", "description": "This is an Framework package(后台服务器版本,端口9527)", "unity": "2021.3",