【m】build apk 开发
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user