OnAssemblyUnloadingAttribute
Marks a static method as a callback that Unity invokes before unloading each assembly.
阅读时间3 分钟最后更新于 14 天前
Definition
- Type: Class
- Namespace: Unity.Scripting.LifecycleManagement
- Assembly: Unity.Scripting
- Inherits from: LifecycleAttributeBase
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]public sealed class OnAssemblyUnloadingAttribute : LifecycleAttributeBase
Remarks
Unity invokes these methods for each assembly in the reverse of the order used by OnAssemblyLoadedAttribute, and after OnCodeUnloadingAttribute 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 |
|---|---|
| OnAssemblyUnloadingAttribute() | Marks the decorated static method to be invoked before the containing assembly is unloaded. |