Files
Cielonos/Assets/Scripts/SLSUtilities/SerializedDictionary/SerializedDictionaryAttributes.cs
SoulliesOfficial 50ee502684 完善
2026-02-13 09:22:11 -05:00

46 lines
1.3 KiB
C#

using System;
using Sirenix.OdinInspector;
namespace SLSUtilities.General
{
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public class DictionaryTitleAttribute : Attribute
{
public string Title;
public DictionaryTitleAttribute(string title)
{
Title = title;
}
}
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
public class ToolbarButtonAttribute : Attribute
{
public string MethodName { get; private set; }
public SdfIconType Icon { get; private set; }
public string Tooltip { get; private set; }
public ToolbarButtonAttribute(string methodName, SdfIconType icon, string tooltip = "")
{
MethodName = methodName;
Icon = icon;
Tooltip = tooltip;
}
}
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public class SerializedDictionarySettingsAttribute : Attribute
{
public string KeyLabel;
public string ValueLabel;
public SerializedDictionarySettingsAttribute(string keyLabel, string valueLabel)
{
KeyLabel = keyLabel;
ValueLabel = valueLabel;
}
// 可选:你还可以加更多设置,比如每行的高度等
}
}