From 3c662e489ea65669d27a86cae1c7636178f0b6a5 Mon Sep 17 00:00:00 2001 From: Alex-Rachel <574809918@qq.com> Date: Mon, 24 Mar 2025 09:26:26 +0800 Subject: [PATCH] =?UTF-8?q?UpdateSetting=20Editor=E4=B8=8D=E9=99=90?= =?UTF-8?q?=E5=AE=9A=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UpdateSetting Editor不限定路径 --- .../Assets/TEngine/Runtime/Module/Settings/Settings.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UnityProject/Assets/TEngine/Runtime/Module/Settings/Settings.cs b/UnityProject/Assets/TEngine/Runtime/Module/Settings/Settings.cs index ab5d8b5a..f3da157a 100644 --- a/UnityProject/Assets/TEngine/Runtime/Module/Settings/Settings.cs +++ b/UnityProject/Assets/TEngine/Runtime/Module/Settings/Settings.cs @@ -44,7 +44,12 @@ namespace TEngine #if UNITY_EDITOR if (Instance == null) { - return UnityEditor.AssetDatabase.LoadAssetAtPath("Assets/TEngine/Settings/UpdateSetting.asset"); + string[] guids = UnityEditor.AssetDatabase.FindAssets("t:UpdateSetting"); + if (guids.Length >= 1) + { + string path = UnityEditor.AssetDatabase.GUIDToAssetPath(guids[0]); + return UnityEditor.AssetDatabase.LoadAssetAtPath(path); + } } #endif return Instance.updateSetting;