Neg_Utils/RequireInterfaceAttribute.cs
2024-02-12 21:26:24 +01:00

24 lines
621 B
C#

using System;
using UnityEngine;
/// <summary>
/// Attribute that require implementation of the provided interface.
/// </summary>
namespace NEG.Utils
{
public class RequireInterfaceAttribute : PropertyAttribute
{
/// <summary>
/// Requiring implementation of the <see cref="T:RequireInterfaceAttribute" /> interface.
/// </summary>
/// <param name="type">Interface type.</param>
public RequireInterfaceAttribute(Type type)
{
requiredType = type;
}
// Interface type.
public Type requiredType { get; private set; }
}
}