Files
ShrinkModFramework/Runtime/Metadata/ShrinkModDependencyAttribute.cs
T
cneicy 78ccae3e07
Publish UPM package / publish (push) Failing after 1s
chore: initialize standalone UPM package
2026-08-26 02:50:31 +08:00

23 lines
780 B
C#

using System;
namespace ShrinkModFramework
{
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public sealed class ShrinkModDependencyAttribute : Attribute
{
public string ModId { get; }
public string MinimumVersion { get; }
public bool Optional { get; }
public ShrinkModDependencyAttribute(string modId, string minimumVersion = null, bool optional = false)
{
if (string.IsNullOrWhiteSpace(modId))
throw new ArgumentException("依赖模组 ID 不能为空。", nameof(modId));
ModId = modId.Trim();
MinimumVersion = string.IsNullOrWhiteSpace(minimumVersion) ? null : minimumVersion.Trim();
Optional = optional;
}
}
}