Documentation

Unity Engine

Unity Engine

ClearCacheBetweenCodeLoadsAttribute

Marks a static method as a callback that clears cached data between code loads.
Read time 3 minutesLast updated 14 days ago

Definition

[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
static
methods with no parameters and return type
void
.

Constructors

Constructor

Description

ClearCacheBetweenCodeLoadsAttribute()Marks the decorated static method to be invoked to clear caches between code loads.

Inheritance

Inherited Members