Files
TheVVaS-Assets/RPGCoreCommon/Settings/Runtime/CustomSettingsAttribute.cs
T
2026-04-25 23:37:10 +02:00

21 lines
709 B
C#

using System;
using System.Text.RegularExpressions;
namespace RPGCoreCommon.Settings
{
[AttributeUsage(AttributeTargets.Class)]
public class CustomSettingsAttribute : Attribute
{
internal string path { private set; get; }
/// <summary>
/// Optionally attached to class that extends <see cref="CustomSettingsSO"/>.<br/>
/// All paths in project should be unique otherwise different name will be generated.
/// </summary>
/// <param name="path">custom path and name with "/" as delimiter.</param>
public CustomSettingsAttribute(string path)
{
this.path = new Regex("/+").Replace(path, "/").Trim('/');
}
}
}