Version: 2022.2
LanguageEnglish
  • C#

Events.registeredPackages

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Parameters

value A PackageRegistrationEventArgs structure describing the modifications to the registered packages list.

Description

Event raised after applying changes to the registered packages list.

Occurs after the asset database is done refreshing, which is after scripts are compiled and the Domain reloaded (if necessary). When you add, update, or remove a package that contains code, a Domain Reload occurs, which resets registered event handlers. To ensure that your event handler is called, use InitializeOnLoadAttribute or InitializeOnLoadMethodAttribute to register the event handler after the Domain Reload occurs but before the event is raised.
Note: There is no guarantee that the AssetPostprocessor will finish by the time this event is raised, so don't rely on the execution order for post-processing events.