This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ShrinkModFramework
|
||||
{
|
||||
[CreateAssetMenu(fileName = "ShrinkModFrameworkSettings", menuName = "ShrinkModFramework/Settings")]
|
||||
public class ShrinkModFrameworkSettings : ScriptableObject
|
||||
{
|
||||
private static ShrinkModFrameworkSettings _instance;
|
||||
|
||||
public static ShrinkModFrameworkSettings Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance) return _instance;
|
||||
|
||||
_instance = Resources.Load<ShrinkModFrameworkSettings>("ShrinkModFrameworkSettings");
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (!_instance)
|
||||
{
|
||||
var guids = UnityEditor.AssetDatabase.FindAssets("t:ShrinkModFrameworkSettings");
|
||||
if (guids.Length > 0)
|
||||
{
|
||||
var path = UnityEditor.AssetDatabase.GUIDToAssetPath(guids[0]);
|
||||
_instance = UnityEditor.AssetDatabase.LoadAssetAtPath<ShrinkModFrameworkSettings>(path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!_instance)
|
||||
{
|
||||
_instance = CreateInstance<ShrinkModFrameworkSettings>();
|
||||
Debug.LogWarning(
|
||||
"[ShrinkModFramework] 未找到 ShrinkModFrameworkSettings 配置文件,当前使用默认配置。");
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
internal set => _instance = value;
|
||||
}
|
||||
|
||||
[Header("Bootstrap")]
|
||||
public bool autoLoadOnStartup = true;
|
||||
[Tooltip("使用 ShrinkContextHost 协调模组组件;关闭时回退到旧的只增不减 ShrinkModLoader。")]
|
||||
public bool useContextHost = true;
|
||||
|
||||
[Header("Logging")]
|
||||
public bool verboseLogging = true;
|
||||
|
||||
[Header("Discovery")]
|
||||
public string[] assemblyNamePrefixes = new string[0];
|
||||
|
||||
[Header("External Mods")]
|
||||
public bool enableExternalDllMods = true;
|
||||
public bool autoCreateExternalModsDirectory = true;
|
||||
public string externalModsFolderName = "Mods";
|
||||
public bool watchExternalModsDirectory = true;
|
||||
public float externalModsReloadDelaySeconds = 0.5f;
|
||||
[Min(1)]
|
||||
[Tooltip("Mono 下外部程序集 revision 会常驻;历史数量达到该软阈值后提示 Domain Reload/重启。")]
|
||||
public int externalAssemblyRevisionSoftLimit = 16;
|
||||
|
||||
[Header("Harmony")]
|
||||
public bool enableHarmonyPatching = true;
|
||||
|
||||
[Header("Networking")]
|
||||
public bool enableNetworkSync = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user