JUtils
A unity utilities library
JUtils.SerializeInterfaceAttribute Class Reference

Restrict the UnityEngine.Object field to extend a certain interface More...

Inheritance diagram for JUtils.SerializeInterfaceAttribute:
Collaboration diagram for JUtils.SerializeInterfaceAttribute:

Public Member Functions

 SerializeInterfaceAttribute (Type type)
 

Public Attributes

readonly Type type
 

Detailed Description

Restrict the UnityEngine.Object field to extend a certain interface

namespace Example
{
public class SerializeInterfaceExample : MonoBehaviour
{
[SerializeInterface(typeof(IProcessor))]
[SerializeField, Required] private Object _processor;
public IProcessor processor => _processor as IProcessor;
}
}
UnityEngine.Object Object
Definition: TypeSelectorEditor.cs:8

Constructor & Destructor Documentation

◆ SerializeInterfaceAttribute()

JUtils.SerializeInterfaceAttribute.SerializeInterfaceAttribute ( Type  type)
inline

Member Data Documentation

◆ type

readonly Type JUtils.SerializeInterfaceAttribute.type

The documentation for this class was generated from the following file: