UpdateSetting Editor不限定路径

UpdateSetting Editor不限定路径
This commit is contained in:
Alex-Rachel
2025-03-24 09:26:26 +08:00
parent 5cebc82ba1
commit 3c662e489e

View File

@@ -44,7 +44,12 @@ namespace TEngine
#if UNITY_EDITOR
if (Instance == null)
{
return UnityEditor.AssetDatabase.LoadAssetAtPath<UpdateSetting>("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<UpdateSetting>(path);
}
}
#endif
return Instance.updateSetting;