Class TypeSelectorAttribute
- Namespace
- Homa.Sdk.Foundation
- Assembly
- Homa.Sdk.Foundation.dll
Attribute used to make a string field in a script be restricted to C# type name.
When this attribute is used, the string be shown as a dropdown button in the Inspector instead of the default string field.
String value represents the type name qualified by its namespace (e.g. "UnityEngine.Object").
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)]
public class TypeSelectorAttribute : PropertyAttribute
- Inheritance
-
PropertyAttributeTypeSelectorAttribute
- Inherited Members
-
PropertyAttribute.order
Constructors
TypeSelectorAttribute(Type)
public TypeSelectorAttribute(Type baseType)
Parameters
baseTypeTypeDetermines the list of valid values for the field. Valid values are the types that implement or derive from this type.
Properties
AllowEmpty
Should the field be allowed to be empty.
public bool AllowEmpty { get; set; }
Property Value
BaseType
Determines the list of valid values for the field. Valid values are the types that implement or derive from this type.
public Type BaseType { get; set; }
Property Value
Filters
Filters to apply when retrieving valid types.
public TypeFilters Filters { get; set; }
Property Value
IncludeBaseType
Should the base type be included in the list of valid values.
[Obsolete("Use 'Filters' instead.")]
public bool IncludeBaseType { get; set; }
Property Value
Methods
GetValidTypes()
Retrieves a collection of valid types based on the attribute settings.
public IEnumerable<Type> GetValidTypes()