Files
BABA_YAGA/Assets/Scripts/Player/Generic/Attributes/vButtonAttribute.cs
2026-06-04 10:42:23 +07:00

31 lines
1.0 KiB
C#

using System;
using UnityEngine;
namespace Invector
{
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = true)]
public class vButtonAttribute : PropertyAttribute
{
public readonly string label;
public readonly string function;
public readonly int id;
public readonly Type type;
public readonly bool enabledJustInPlayMode;
/// <summary>
/// Create a button in Inspector
/// </summary>
/// <param name="label">button label</param>
/// <param name="function">function to call on press</param>
/// <param name="type">parent class type button</param>
/// <param name="enabledJustInPlayMode">button is enabled just in play mode</param>
public vButtonAttribute(string label, string function, Type type, bool enabledJustInPlayMode = true)
{
this.label = label;
this.function = function;
this.type = type;
this.enabledJustInPlayMode = enabledJustInPlayMode;
}
}
}