【m】处理由于非编辑器环境加载SceneAsset导致的打包报错

This commit is contained in:
mzh
2026-03-31 16:46:11 +08:00
parent 7426c4db7f
commit b7fe92eb39
4 changed files with 8 additions and 5 deletions

View File

@@ -80,11 +80,11 @@ namespace Stary.Evo
[LabelText("资源加载场景")]
[Required("如果需要场景作为资源加载过程中的过渡,请将其拖到此处")]
public SceneAsset loadingScene;
/// <summary>
/// 资源加载场景(路径)
/// </summary>
public string loadingScenePath => AssetDatabase.GetAssetPath(loadingScene);
public string loadingScenePath;
}
[Serializable]

View File

@@ -1,6 +1,6 @@
{
"name": "com.staryevo.main",
"version": "2.1.1",
"version": "2.1.2",
"displayName": "00.StaryEvo",
"description": "This is an Framework package(后台服务器版本端口9527)",
"unity": "2021.3",

View File

@@ -8,8 +8,11 @@ public class HotfixMainResDomainEditor : OdinEditor
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
var config = (HotfixMainResDomain)target;
config.projectInfo.loadingScenePath = AssetDatabase.GetAssetPath(config.projectInfo.loadingScene);
config.projectInfo.projectPackageName = $"com.xosmo.{config.projectInfo.projectCode}";
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "com.staryevo.tools",
"version": "1.3.32",
"version": "1.3.33",
"displayName": "00.StaryEvo.Tools",
"description": "This is an Framework package(后台服务器版本端口9527)",
"unity": "2021.3",