Add RequireInterfaceAttibute

This commit is contained in:
Hubert Mattusch 2022-09-13 13:08:31 +02:00
parent f30c5cd5cf
commit 6c6ef9ad0d
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,17 @@
using UnityEngine;
/// <summary>
/// Attribute that require implementation of the provided interface.
/// </summary>
public class RequireInterfaceAttribute : PropertyAttribute
{
// Interface type.
public System.Type requiredType { get; private set; }
/// <summary>
/// Requiring implementation of the <see cref="T:RequireInterfaceAttribute"/> interface.
/// </summary>
/// <param name="type">Interface type.</param>
public RequireInterfaceAttribute(System.Type type)
{
this.requiredType = type;
}
}

View File

@ -1 +0,0 @@