Unity.Scripting
Contains the attributes that control how scripting code and static state are loaded, unloaded, and reset across code reloads and Play mode transitions.
Read time 2 minutesLast updated 3 hours ago
Definition
- Type: Module
Classes
Class | Description |
|---|---|
| AlwaysLinkAssemblyAttribute | Ensure an assembly is always processed during managed code stripping. |
| AutoStaticsCleanupAttribute | Resets static variables automatically on entering or exiting Play mode with code reload disabled. |
| ClassAutoCleanup | This class supports code generation for the AutoStaticsCleanupAttribute and is public to allow the code generator to subclass it in Unity project code. Don't attempt to use this class directly. |
| ClearCacheBetweenCodeLoadsAttribute | Marks a static method as a callback that clears cached data between code loads. |
| DelegateAutoCleanup | Class used by the source generator to reset static variables when entering or exiting Play mode with code reload disabled. Don't attempt to use this class directly. |
| LifecycleAttributeBase | Base class for lifecycle callback attributes. |
| LifecycleMethodRegistration | Infrastructure class used by generated code to register lifecycle callback methods. Not intended for direct use. |
| NoAutoStaticsCleanupAttribute | Prevents static variables from being automatically reset on entering or exiting Play mode with code reload disabled. |
| OnAssemblyLoadedAttribute | Marks a static method as a callback that Unity invokes after Unity loads each assembly. |
| OnAssemblyUnloadingAttribute | Marks a static method as a callback that Unity invokes before unloading each assembly. |
| OnCodeDeinitializingAttribute | Marks a static method as a callback to be invoked before managed objects are backed up for a code reload. |
| OnCodeInitializingAttribute | Marks a static method as a callback to be invoked after managed objects have been restored following a code reload. |
| OnCodeLoadedAttribute | Marks a static method as a callback that Unity invokes after it loads code at startup or after a code reload. |
| OnCodeUnloadingAttribute | Marks a static method as a callback to be invoked before code is unloaded during a code reload. |
| OnEnteringPlayModeAttribute | Marks a static method as a callback to be invoked when entering Play mode. |
| OnExitingPlayModeAttribute | Marks a static method as a callback to be invoked when exiting Play mode. |
| RequireAttributeUsagesAttribute | Only allowed on attribute types. If the attribute type is marked, then so too will all CustomAttributes of that type. |
| RequiredByAssemblyAttribute | When an assembly is marked, all types and members with [RequiredByAssembly] are marked. |
| RequireDerivedAttribute | When the type is marked, all types derived from that type will also be marked. |
| RequiredInterfaceAttribute | When a type is marked, all interface implementations of the specified types will be marked. |
| RequiredMemberAttribute | When a type is marked, all of its members with [RequiredMember] are marked. |
| RequireImplementorsAttribute | When the interface type is marked, all types implementing that interface will be marked. |
| StubBodyIfTypeNotInstantiatedAttribute | This attribute supports code generation for Managed Serialization and is public to allow the code generator to access it in Unity project code. Don't attempt to use this attribute directly. |