اقرأ باللغة الإنجليزية تحرير

مشاركة عبر


InterfaceSelectorAttribute Class

Definition

This attaches a Unity Inspector drawer that will enable selection and instantiation of concrete classes that are assignable to this field. This pairs best with an interface and the [SerializeReference] attribute, though technically any parent class type will work!

C#
[System.AttributeUsage(System.AttributeTargets.Field)]
public class InterfaceSelectorAttribute : UnityEngine.PropertyAttribute
Inheritance
UnityEngine.PropertyAttribute
InterfaceSelectorAttribute
Attributes

Constructors

InterfaceSelectorAttribute(Boolean)

This attaches a Unity Inspector drawer that will enable selection and instantiation of concrete classes that are assignable to this field. This pairs best with an interface and the [SerializeReference] attribute, though technically any parent class type will work!

Properties

AllowNull

Should the inspector add an option to set this field to null, or is null a bad idea for this field? This does not mean it's impossible for this field to be null if 'false'.

Applies to

منتج الإصدارات
MRTK3 Core Definitions 3.0, 3.1, 3.2