文档

Unity Engine

Unity Engine

OnAssemblyLoadedAttribute

Marks a static method as a callback that Unity invokes after Unity loads each assembly.
阅读时间3 分钟最后更新于 14 天前

Definition

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]public sealed class OnAssemblyLoadedAttribute : LifecycleAttributeBase

Remarks

Unity invokes these methods for each assembly in dependency order, so an assembly's dependencies are processed first, and before OnCodeLoadedAttribute callbacks run.
Use this callback for setup or teardown that applies to one assembly. For work that needs every assembly to be loaded, use OnCodeLoadedAttribute and OnCodeUnloadingAttribute instead.
This is a method attribute that can only be applied to
static
methods with no parameters and return type
void
.

Constructors

Constructor

Description

OnAssemblyLoadedAttribute()Marks the decorated static method to be invoked after the containing assembly has been loaded.

Inheritance

Inherited Members