Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

LifecycleAttributeBase

class in Unity.Scripting.LifecycleManagement

/

Inherits from:Scripting.RequiredMemberAttribute

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

Description

Base class for lifecycle callback attributes.

This is the abstract base class for all lifecycle callback attributes. Do not inherit from this class directly; use the specific lifecycle attributes instead:

Lifecycle Timing:

Code reload order (Editor only):

  1. OnCodeDeinitializingAttribute - Objects serialized.
  2. OnCodeUnloadingAttribute - Code about to unload.
  3. (Code unloads and reloads)
  4. OnCodeLoadedAttribute - Code loaded.
  5. OnCodeInitializingAttribute - Objects deserialized.

Initial code load (Editor and Player):

  1. OnCodeLoadedAttribute - Code loaded.
  2. OnCodeInitializingAttribute - Called before initial scene loads.

Shutdown (Editor and Player):

1. OnCodeUnloadingAttribute - Code about to unload.

Additional resources: OnCodeLoadedAttribute, OnCodeInitializingAttribute.

Inherited Members