diff --git a/Assets/00.StaryEvo/Editor/Build/BuildApkWindow.cs b/Assets/00.StaryEvo/Editor/Build/BuildApkWindow.cs index d752a1c..db526e4 100644 --- a/Assets/00.StaryEvo/Editor/Build/BuildApkWindow.cs +++ b/Assets/00.StaryEvo/Editor/Build/BuildApkWindow.cs @@ -86,29 +86,17 @@ public class BuildApkWindow : OdinEditorWindow 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[] { - $"{loadingScenePath}", + hotfixMainResDomain.projectInfo.loadingScenePath, $"Assets/Main/main_{deviceType.ToString()}.unity" }, locationPathName = $"Builds/Android/{PlayerSettings.applicationIdentifier}.apk", diff --git a/Assets/00.StaryEvo/Editor/Entity/HotfixMainResDomainEditor.cs b/Assets/00.StaryEvo/Editor/Entity/HotfixMainResDomainEditor.cs index 2807efe..fee5917 100644 --- a/Assets/00.StaryEvo/Editor/Entity/HotfixMainResDomainEditor.cs +++ b/Assets/00.StaryEvo/Editor/Entity/HotfixMainResDomainEditor.cs @@ -25,5 +25,13 @@ public class HotfixMainResDomainEditor : UnityEditor.Editor base.OnInspectorGUI(); HotfixMainResDomain hotfixMainResDomain = (HotfixMainResDomain)target; hotfixMainResDomain.projectInfo.projectPackageName = $"com.xosmo.{hotfixMainResDomain.projectInfo.projectCode}"; + + if (hotfixMainResDomain.projectInfo.loadingScene == null) + { + Debug.LogError("HotfixMainResDomain 资源中loadingScene索引不存在,请检查!"); + return; + } + // 获取loadingScene的Assets相对路径 + hotfixMainResDomain.projectInfo.loadingScenePath = AssetDatabase.GetAssetPath(hotfixMainResDomain.projectInfo.loadingScene); } } \ No newline at end of file diff --git a/Assets/00.StaryEvo/Runtime/PlayerSettings/HotfixMainResDomain.cs b/Assets/00.StaryEvo/Runtime/PlayerSettings/HotfixMainResDomain.cs index b974eaa..5f98e68 100644 --- a/Assets/00.StaryEvo/Runtime/PlayerSettings/HotfixMainResDomain.cs +++ b/Assets/00.StaryEvo/Runtime/PlayerSettings/HotfixMainResDomain.cs @@ -20,6 +20,7 @@ namespace Stary.Evo public string username = "UnityHot"; public string password = "Unity1234"; } + [Serializable] public class ProjectInfo { @@ -32,14 +33,18 @@ namespace Stary.Evo /// 项目代号 /// public string projectCode; + /// /// 项目包名 /// - [ReadOnly] - public string projectPackageName; + [ReadOnly] public string projectPackageName; +#if UNITY_EDITOR public SceneAsset loadingScene; +#endif + [ReadOnly] + public string loadingScenePath; } } \ No newline at end of file diff --git a/Assets/00.StaryEvo/package.json b/Assets/00.StaryEvo/package.json index 04ff1c3..4823ace 100644 --- a/Assets/00.StaryEvo/package.json +++ b/Assets/00.StaryEvo/package.json @@ -1,6 +1,6 @@ { "name": "com.staryevo.main", - "version": "1.3.11", + "version": "1.3.12", "displayName": "00.StaryEvo", "description": "This is an Framework package(后台服务器版本,端口9527)", "unity": "2021.3",