【m】增加打包前设置

This commit is contained in:
2025-07-14 18:26:17 +08:00
parent 00dfc7cbe8
commit b6d4466bab
2 changed files with 22 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ using Stary.Evo.Editor;
using UnityEditor; using UnityEditor;
using UnityEditor.Build; using UnityEditor.Build;
using UnityEditor.Callbacks; using UnityEditor.Callbacks;
using UnityEngine;
namespace Stary.Evo namespace Stary.Evo
{ {
@@ -14,7 +15,27 @@ namespace Stary.Evo
public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report) public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
{ {
// build前 // build前
if (ChangePlayerSchema.PLayerMode == PLayerMode.EDITOR_SIMULATEMODE)
{
int id = EditorUtility.DisplayDialogComplex("提示",
$"当前为[{PLayerMode.EDITOR_SIMULATEMODE}]模式,请选择切换得热更模式!",
$"{PLayerMode.HOST_PLAYMODE}", $"{PLayerMode.OFFLINE_PLAYMODE}", "取消");
switch (id)
{
case 0:
ChangePlayerSchema.SetPlayerMode(PLayerMode.HOST_PLAYMODE);
Debug.Log("切换为[HOST_PLAYMODE]模式");
break;
case 1:
ChangePlayerSchema.SetPlayerMode(PLayerMode.OFFLINE_PLAYMODE);
Debug.Log("切换为[OFFLINE_PLAYMODE]模式");
break;
case 2:
break;
}
}
} }
public void OnPostprocessBuild(UnityEditor.Build.Reporting.BuildReport report) public void OnPostprocessBuild(UnityEditor.Build.Reporting.BuildReport report)

View File

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