Interface IProperty<TContainer> | Properties | 1.3.1-preview
docs.unity.cn
    Show / Hide Table of Contents

    Interface IProperty<TContainer>

    Base interface for working with properties.

    Inherited Members
    IProperty.Name
    IProperty.IsReadOnly
    IProperty.DeclaredValueType()
    IProperty.HasAttribute<TAttribute>()
    IProperty.GetAttribute<TAttribute>()
    IProperty.GetAttributes<TAttribute>()
    IProperty.GetAttributes()
    Namespace: Unity.Properties
    Syntax
    public interface IProperty<TContainer> : IProperty
    Type Parameters
    Name Description
    TContainer

    The container type this property operates on.

    Remarks

    This is used to pass or store properties without knowing the underlying value type.

    • Property<TContainer, TValue>

    Methods

    GetValue(ref TContainer)

    Returns the property value of a specified container.

    Declaration
    object GetValue(ref TContainer container)
    Parameters
    Type Name Description
    TContainer container

    The container whose property value will be returned.

    Returns
    Type Description
    Object

    The property value of the given container.

    TrySetValue(ref TContainer, Object)

    Sets the property value of a specified container.

    Declaration
    bool TrySetValue(ref TContainer container, object value)
    Parameters
    Type Name Description
    TContainer container

    The container whose property value will be set.

    Object value

    The new property value.

    Returns
    Type Description
    Boolean

    true if the value was set; otherwise, false.

    Extension Methods

    PropertyVisitExtensions.Visit<TValue>(IProperty, PropertyVisitor, ref TValue)
    PropertyVisitExtensions.Visit<TValue>(IProperty, PropertyVisitor, ref TValue, Int32)
    PropertyVisitExtensions.Visit<TValue>(IProperty, PropertyVisitor, ref TValue, Object)
    PropertyAttributeExtensions.WithAttribute<TProperty>(TProperty, Attribute)
    PropertyAttributeExtensions.WithAttributes<TProperty>(TProperty, IEnumerable<Attribute>)
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX