文档

Unity Engine

Unity Engine

Property<TContainer, TValue>

Base class for implementing properties. This is an abstract class.
阅读时间1 分钟最后更新于 1 个月前

Definition

public abstract class Property<TContainer, TValue> : IProperty<TContainer>, IProperty, IPropertyAccept<TContainer>

Remarks

A IProperty is used as an accessor to the underlying data of a container.

Properties

Property

Description

IsReadOnlyGets a value indicating whether the property is read-only or not.
NameGets the name of the property.

Methods

Method

Description

AcceptCall this method to invoke IPropertyVisitor.Visit with the strongly typed container and value.
AddAttributeAdds an attribute to the property.
AddAttributesAdds a set of attributes to the property.
DeclaredValueTypeReturns the declared value type of the property.
GetAttributeReturns the first attribute of the given type.
GetAttributesReturns all attribute for this property.
GetValueReturns the property value of a specified container.
HasAttributeReturns true if the property has any attributes of the given type.
SetValueSets the property value of a specified container.