1
This commit is contained in:
@@ -15,8 +15,8 @@ namespace Stary.Evo.Editor
|
|||||||
|
|
||||||
private static HotUpdateMode _hotUpdate;
|
private static HotUpdateMode _hotUpdate;
|
||||||
|
|
||||||
private const string EditorNotUpdateMode = "Evo/ChangeHotUpdateSchema/NOTUPDARE(非热更模式)";
|
private const string EditorNotUpdateMode = "Evo/Schema/ChangeHotUpdate/NOTUPDARE(非热更模式)";
|
||||||
private const string EditorHotUpdateMode = "Evo/ChangeHotUpdateSchema/HOTUPDATE(热更模式)";
|
private const string EditorHotUpdateMode = "Evo/Schema/ChangeHotUpdate/HOTUPDATE(热更模式)";
|
||||||
|
|
||||||
[MenuItem(EditorNotUpdateMode)]
|
[MenuItem(EditorNotUpdateMode)]
|
||||||
private static void SetNotUpdateMode() => SetHotUpdateMode(HotUpdateMode.NotUpdate);
|
private static void SetNotUpdateMode() => SetHotUpdateMode(HotUpdateMode.NotUpdate);
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ namespace Stary.Evo.Editor
|
|||||||
|
|
||||||
private static PLayerMode _pLayerMode;
|
private static PLayerMode _pLayerMode;
|
||||||
|
|
||||||
private const string EditorSimulateMode = "Evo/ChangePlayerSchema/EditorSimulateMode(编辑器调试模式)";
|
private const string EditorSimulateMode = "Evo/Schema/ChangePlayer/EditorSimulateMode(编辑器调试模式)";
|
||||||
private const string OfflinePlayMode = "Evo/ChangePlayerSchema/OfflinePlayMode(本地运行模式)";
|
private const string OfflinePlayMode = "Evo/Schema/ChangePlayer/OfflinePlayMode(本地运行模式)";
|
||||||
private const string HostPlayMode = "Evo/ChangePlayerSchema/HostPlayMode(服务器运行模式)";
|
private const string HostPlayMode = "Evo/Schema/ChangePlayer/HostPlayMode(服务器运行模式)";
|
||||||
private const string WebPlayMode = "Evo/ChangePlayerSchema/WebPlayMode(Web运行模式)";
|
private const string WebPlayMode = "Evo/Schema/ChangePlayer/WebPlayMode(Web运行模式)";
|
||||||
|
|
||||||
[MenuItem(EditorSimulateMode)]
|
[MenuItem(EditorSimulateMode)]
|
||||||
private static void SetEditorMode() => SetPlayerMode(PLayerMode.EDITOR_SIMULATEMODE);
|
private static void SetEditorMode() => SetPlayerMode(PLayerMode.EDITOR_SIMULATEMODE);
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Stary.Evo.Editor
|
||||||
|
{
|
||||||
|
public class ChangePointClondMode
|
||||||
|
{
|
||||||
|
public static PointClondMode PointClondMode
|
||||||
|
{
|
||||||
|
get => _pointClondMode;
|
||||||
|
set => SetPoindClondMode(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static PointClondMode _pointClondMode;
|
||||||
|
|
||||||
|
private const string EditorNotMode = "Evo/Schema/ChangePointClond/NotPointClond";
|
||||||
|
private const string EditorImmersalMode = "Evo/Schema/ChangePointClond/Immersal";
|
||||||
|
|
||||||
|
[MenuItem(EditorNotMode)]
|
||||||
|
private static void SetNotMode() => SetPoindClondMode(PointClondMode.NotPointClond);
|
||||||
|
|
||||||
|
[MenuItem(EditorImmersalMode)]
|
||||||
|
private static void SetImmersalMode() => SetPoindClondMode(PointClondMode.Immersal);
|
||||||
|
|
||||||
|
// [MenuItem(WebPlayMode)]
|
||||||
|
// private static void SetWebMode() => SetPlayerMode(HotUpdateMode.WEB_PLAYMODE);
|
||||||
|
|
||||||
|
[MenuItem(EditorNotMode, true)]
|
||||||
|
private static bool ValidateModeMenu()
|
||||||
|
{
|
||||||
|
string platform = EditorPrefs.GetString("ChangeHotUpdateSchema");
|
||||||
|
Menu.SetChecked(EditorNotMode, platform == HotUpdateMode.NotUpdate.ToString());
|
||||||
|
Menu.SetChecked(EditorImmersalMode, platform == HotUpdateMode.HotUpdate.ToString());
|
||||||
|
//Menu.SetChecked(WebPlayMode, platform == HotUpdateMode.WEB_PLAYMODE.ToString());
|
||||||
|
Debug.LogError("ChangeHotUpdateSchema");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetPoindClondMode(PointClondMode mode)
|
||||||
|
{
|
||||||
|
// 清除所有旧模式定义
|
||||||
|
var currentTarget = EditorUserBuildSettings.selectedBuildTargetGroup;
|
||||||
|
if (currentTarget == BuildTargetGroup.Unknown) return;
|
||||||
|
|
||||||
|
var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(currentTarget)
|
||||||
|
.Split(';')
|
||||||
|
.Where(d => !Enum.GetNames(typeof(HotUpdateMode)).Contains(d))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
// 添加新模式
|
||||||
|
defines.Add(mode.ToString());
|
||||||
|
PlayerSettings.SetScriptingDefineSymbolsForGroup(currentTarget, string.Join(";", defines));
|
||||||
|
Debug.Log($"当前编译符号: {string.Join(";", defines)}"); // 添加调试日志
|
||||||
|
_pointClondMode = mode;
|
||||||
|
EditorPrefs.SetString("ChangeHotUpdateSchema", _pointClondMode.ToString());
|
||||||
|
|
||||||
|
ValidateModeMenu();
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
// 添加解决方案文件重新生成逻辑
|
||||||
|
EditorApplication.delayCall += () =>
|
||||||
|
{
|
||||||
|
EditorApplication.ExecuteMenuItem("Assets/Open C# Project");
|
||||||
|
UnityEditor.Compilation.CompilationPipeline.RequestScriptCompilation();
|
||||||
|
Debug.Log("已强制重新生成解决方案文件");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PointClondMode
|
||||||
|
{
|
||||||
|
//非点云模式,
|
||||||
|
NotPointClond,
|
||||||
|
//Immersal模式
|
||||||
|
Immersal,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 076111eb4cfd413287c1d7f299fe5a1f
|
||||||
|
timeCreated: 1757471872
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.main",
|
"name": "com.staryevo.main",
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"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",
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using Cysharp.Threading.Tasks;
|
using Cysharp.Threading.Tasks;
|
||||||
|
|
||||||
|
#if Immersal
|
||||||
using Immersal.AR;
|
using Immersal.AR;
|
||||||
|
#endif
|
||||||
using Stary.Evo;
|
using Stary.Evo;
|
||||||
using Stary.Evo.InformationSave;
|
using Stary.Evo.InformationSave;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -44,17 +47,21 @@ namespace Stary.Evo
|
|||||||
await loadOperation;
|
await loadOperation;
|
||||||
if (loadOperation.Status == EOperationStatus.Succeed)
|
if (loadOperation.Status == EOperationStatus.Succeed)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if Immersal
|
||||||
ARSpace arSpace = GameObject.FindObjectOfType<ARSpace>();
|
ARSpace arSpace = GameObject.FindObjectOfType<ARSpace>();
|
||||||
if (arSpace != null)
|
if (arSpace != null)
|
||||||
{
|
{
|
||||||
Debug.Log("UnityEvo:找到ARSpace,开始加载点云运行环境...");
|
Debug.Log("UnityEvo:找到ARSpace,开始加载点云运行环境...");
|
||||||
mainPrefab = loadOperation.InstantiateSync(arSpace.transform);
|
mainPrefab = loadOperation.InstantiateSync(arSpace.transform);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
Debug.Log("UnityEvo:未找到ARSpace,开始加载普通运行环境,通过语音唤醒...");
|
Debug.Log("UnityEvo:未找到ARSpace,开始加载普通运行环境,通过语音唤醒...");
|
||||||
mainPrefab = loadOperation.InstantiateSync();
|
mainPrefab = loadOperation.InstantiateSync();
|
||||||
}
|
}
|
||||||
|
#elif NotPointClond
|
||||||
|
mainPrefab = loadOperation.InstantiateSync();
|
||||||
|
#endif
|
||||||
if(domainConfig.domain =="Main")
|
if(domainConfig.domain =="Main")
|
||||||
AppConfig.SetDefaultMainInstance(mainPrefab);
|
AppConfig.SetDefaultMainInstance(mainPrefab);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.tools",
|
"name": "com.staryevo.tools",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"displayName": "00.StaryEvo.Tools",
|
"displayName": "00.StaryEvo.Tools",
|
||||||
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
"description": "This is an Framework package(后台服务器版本,端口9527)",
|
||||||
"unity": "2021.3",
|
"unity": "2021.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user