DictionaryPool<TKey, TValue>
A version of CollectionPool<TCollection, TItem> for Dictionaries.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine.Pool
- Assembly: UnityEngine.CoreModule
- Inherits from: CollectionPool<Dictionary<T, T>, KeyValuePair<T, T>>
public class DictionaryPool<TKey, TValue> : CollectionPool<Dictionary<TKey, TValue>, KeyValuePair<TKey, TValue>>
Examples
using UnityEngine.Pool;public class Example{ void GetPooled() { // Get a pooled instance var instance = DictionaryPool<int, int>.Get(); // Use the Dictionary // Return it back to the pool DictionaryPool<int, int>.Release(instance); }}