docs.unity.cn
    Show / Hide Table of Contents

    Class ContainerPropertyBag<TContainer>

    Base class for implementing a static property bag for a specified container type. This is an abstract class.

    Inheritance
    Object
    PropertyBag<TContainer>
    ContainerPropertyBag<TContainer>
    Namespace: Unity.Properties
    Syntax
    public abstract class ContainerPropertyBag<TContainer> : PropertyBag<TContainer>, IPropertyBag<TContainer>, IPropertyBag, IPropertyBagAccept, IContainerTypeAccept, IPropertyBagAccept<TContainer>, IPropertyEnumerable<TContainer>, IPropertyList<TContainer>, IPropertyNameable<TContainer>
    Type Parameters
    Name Description
    TContainer

    The container type.

    Remarks

    A ContainerPropertyBag<TContainer> is used to describe and traverse the properties for a specified TContainer type.

    In order for properties to operate on a type, a ContainerPropertyBag<TContainer> must exist and be pre-registered for that type.

    NOTE In editor use cases property bags can be generated dynamically through reflection. (see Unity.Properties.Reflection)

    Methods

    AddProperty<TValue>(Property<TContainer, TValue>)

    Adds a Property<TContainer, TValue> to the property bag.

    Declaration
    protected void AddProperty<TValue>(Property<TContainer, TValue> property)
    Parameters
    Type Name Description
    Property<TContainer, TValue> property

    The Property<TContainer, TValue> to add.

    Type Parameters
    Name Description
    TValue

    The value type for the given property.

    TryGetProperty(ref TContainer, String, out IProperty<TContainer>)

    Declaration
    public bool TryGetProperty(ref TContainer container, string name, out IProperty<TContainer> property)
    Parameters
    Type Name Description
    TContainer container
    String name
    IProperty<TContainer> property
    Returns
    Type Description
    Boolean
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Wednesday, January 26, 2022
    Terms of use