OnAssemblyLoadedAttribute
Marks a static method as a callback that Unity invokes after Unity loads each assembly.
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 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 methods with no parameters and return type .
staticvoidAdditional Resources: OnCodeLoadedAttribute, OnCodeUnloadingAttribute.
Constructors
Constructor | Description |
|---|---|
| OnAssemblyLoadedAttribute() | Marks the decorated static method to be invoked after the containing assembly has been loaded. |