using System; namespace UnityEngine.XR.Interaction.Toolkit.Utilities.Internal { /// /// Add this attribute to a serialized Unity Object field (or its subclasses, including MonoBehaviours and ScriptableObjects) /// to allow the Inspector to validate if the referenced object implements the given interface. /// /// /// This attribute does not support multiple interfaces nor generic interfaces. /// The interface implementation check is ignored for references dragged into the foldout array (or list) in the /// Inspector. /// class RequireInterfaceAttribute : PropertyAttribute { /// /// The interface type that the referenced object should implement. /// public Type interfaceType { get; } /// /// Initializes the attribute specifying the interface that the reference Unity Object should implement. /// /// The interface type. public RequireInterfaceAttribute(Type interfaceType) { this.interfaceType = interfaceType; } } }