# PropertyBag<TContainer>

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

## Definition

* **Type:** Class
* **Namespace:** [Unity.Properties](/engine/6000.7/script-reference/unity/properties.md)
* **Assembly:** UnityEngine.PropertiesModule
* **Implements:** [IPropertyBag\<T>](/engine/6000.7/script-reference/unity/properties/ipropertybag1.md), [IPropertyBag](/engine/6000.7/script-reference/unity/properties/ipropertybag.md)

```csharp
public abstract class PropertyBag<TContainer> : IPropertyBag<TContainer>, IPropertyBag
```

## Remarks

This is used as the base class internally and should NOT be extended.

When implementing custom property bags use: " [ContainerPropertyBag\<TContainer>](/engine/6000.7/script-reference/unity/properties/containerpropertybag1.md). " [IndexedCollectionPropertyBag\<TList, TElement>](/engine/6000.7/script-reference/unity/properties/indexedcollectionpropertybag2.md).

## Properties

| Property                                                                                                | Description                                                                                          |
| ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [InstantiationKind](/engine/6000.7/script-reference/unity/properties/propertybag1/instantiationkind.md) | Implement this property and return true to provide custom type instantiation for the container type. |

## Methods

| Method                                                                                                  | Description                                                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Accept](/engine/6000.7/script-reference/unity/properties/propertybag1/accept.md)                       | Accepts visitation from a specified [ITypeVisitor](/engine/6000.7/script-reference/unity/properties/itypevisitor.md).                                                                                        |
| [CreateInstance](/engine/6000.7/script-reference/unity/properties/propertybag1/createinstance.md)       | Creates and returns a new instance of `TContainer`.                                                                                                                                                          |
| [GetProperties](/engine/6000.7/script-reference/unity/properties/propertybag1/getproperties.md)         | Implement this method to return a [PropertyCollection\<TContainer>](/engine/6000.7/script-reference/unity/properties/propertycollection1.md) that can enumerate through all properties for the `TContainer`. |
| [Instantiate](/engine/6000.7/script-reference/unity/properties/propertybag1/instantiate.md)             | Implement this method to provide custom type instantiation for the container type.                                                                                                                           |
| [TryCreateInstance](/engine/6000.7/script-reference/unity/properties/propertybag1/trycreateinstance.md) | Tries to create a new instance of `TContainer`.                                                                                                                                                              |
