【m】build apk 开发

This commit is contained in:
2025-07-02 17:58:55 +08:00
parent 9e46410516
commit 15289e30c5
3 changed files with 21 additions and 2 deletions

View File

@@ -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",

View File

@@ -1,5 +1,6 @@
using System;
using Sirenix.OdinInspector;
using UnityEditor;
using UnityEngine;
namespace Stary.Evo
@@ -36,5 +37,9 @@ namespace Stary.Evo
/// </summary>
[ReadOnly]
public string projectPackageName;
public SceneAsset loadingScene;
}
}

View File

@@ -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",