Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


LifecycleAttributeBase

Base class for lifecycle callback attributes.
Read time 3 minutesLast updated 6 days ago

Definition

public abstract class LifecycleAttributeBase : RequiredMemberAttribute

Remarks

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.

Inheritance

Inherited Members