67 lines
2.3 KiB
C#
67 lines
2.3 KiB
C#
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;
|
|
|
|
[Header("Harmony")]
|
|
public bool enableHarmonyPatching = true;
|
|
|
|
[Header("Networking")]
|
|
public bool enableNetworkSync = true;
|
|
}
|
|
}
|