ClearCacheBetweenCodeLoadsAttribute
Marks a static method as a callback that clears cached data between code loads.
Read time 3 minutesLast updated 14 days ago
Definition
- Type: Class
- Namespace: Unity.Scripting.LifecycleManagement
- Assembly: Unity.Scripting
- Inherits from: LifecycleAttributeBase
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]public sealed class ClearCacheBetweenCodeLoadsAttribute : LifecycleAttributeBase
Remarks
Unity invokes methods marked with this attribute after all OnCodeUnloadingAttribute callbacks have run and before OnCodeLoadedAttribute callbacks run. Use it to discard caches that hold data from the previous code load.
This is a method attribute that can only be applied to methods with no parameters and return type .
staticvoidAdditional Resources: OnCodeUnloadingAttribute, OnCodeLoadedAttribute.
Constructors
Constructor | Description |
|---|---|
| ClearCacheBetweenCodeLoadsAttribute() | Marks the decorated static method to be invoked to clear caches between code loads. |