This commit is contained in:
@@ -5,6 +5,10 @@ namespace ShrinkModFramework
|
||||
[CreateAssetMenu(fileName = "ShrinkModFrameworkSettings", menuName = "ShrinkSDK/模组/模组设置")]
|
||||
public class ShrinkModFrameworkSettings : ScriptableObject
|
||||
{
|
||||
public const string PreferredResourcesPath =
|
||||
"GameAssets/Runtime/Data/ShrinkSDK/ShrinkModFrameworkSettings";
|
||||
public const string LegacyResourcesPath = "ShrinkModFrameworkSettings";
|
||||
|
||||
private static ShrinkModFrameworkSettings _instance;
|
||||
|
||||
public static ShrinkModFrameworkSettings Instance
|
||||
@@ -13,7 +17,9 @@ namespace ShrinkModFramework
|
||||
{
|
||||
if (_instance) return _instance;
|
||||
|
||||
_instance = Resources.Load<ShrinkModFrameworkSettings>("ShrinkModFrameworkSettings");
|
||||
_instance = Resources.Load<ShrinkModFrameworkSettings>(PreferredResourcesPath);
|
||||
if (!_instance)
|
||||
_instance = Resources.Load<ShrinkModFrameworkSettings>(LegacyResourcesPath);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (!_instance)
|
||||
@@ -39,8 +45,13 @@ namespace ShrinkModFramework
|
||||
internal set => _instance = value;
|
||||
}
|
||||
|
||||
internal static void ResetCachedInstance()
|
||||
{
|
||||
_instance = null;
|
||||
}
|
||||
|
||||
[Header("Bootstrap")]
|
||||
public bool autoLoadOnStartup = true;
|
||||
public bool autoLoadOnStartup;
|
||||
[Tooltip("使用 ShrinkContextHost 协调模组组件;关闭时回退到旧的只增不减 ShrinkModLoader。")]
|
||||
public bool useContextHost = true;
|
||||
|
||||
@@ -51,10 +62,10 @@ namespace ShrinkModFramework
|
||||
public string[] assemblyNamePrefixes = new string[0];
|
||||
|
||||
[Header("External Mods")]
|
||||
public bool enableExternalDllMods = true;
|
||||
public bool enableExternalDllMods;
|
||||
public bool autoCreateExternalModsDirectory = true;
|
||||
public string externalModsFolderName = "Mods";
|
||||
public bool watchExternalModsDirectory = true;
|
||||
public bool watchExternalModsDirectory;
|
||||
public float externalModsReloadDelaySeconds = 0.5f;
|
||||
[Min(1)]
|
||||
[Tooltip("Mono 下外部程序集 revision 会常驻;历史数量达到该软阈值后提示 Domain Reload/重启。")]
|
||||
|
||||
Reference in New Issue
Block a user