Provides an easy way of claiming and freeing cached values of any non-abstract reference type with a public parameterless constructor.

Cached types which implement the ICacheNotificationReceiver interface will receive notifications when they are claimed and freed.

namespace Sirenix.Utilities
public sealed class Cache<T> : ICache<T>


Namespace: Sirenix.Utilities
Assembly: Sirenix.OdinInspector

See Also

  • IDisposable

Static Properties

Return Type Definition Description
int MaxCacheSize Gets or sets the maximum size of the cache. This value can never go beneath 1.

Static Methods

Return Type Definition Description
Cache<T> Claim() Claims a cached value of type !:T.
T op_Implicit(Cache<T>) Performs an implicit conversion from Cache<T> to !:T.
void Release(Cache<T>) Releases a cached value.


Return Type Definition Description
T Value Gets the cached value.