Interface IProperty<TContainer> | Properties | 1.1.1-preview
docs.unity3d.com
    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 © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023