文档

Unity Engine

Unity Engine

ClearCacheBetweenCodeLoadsAttribute

Marks a static method as a callback that clears cached data between code loads.
阅读时间3 分钟最后更新于 14 天前

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