# DelegateAutoCleanup

> Class used by the source generator to reset static variables when entering or exiting Play mode with domain reload disabled. Don't attempt to use this class directly.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** Unity.Scripting
* **Inherits from:** [ClassAutoCleanup](/engine/6000.7/script-reference/unity/scripting/lifecyclemanagement/codegen/classautocleanup.md)

```csharp
public sealed class DelegateAutoCleanup : ClassAutoCleanup
```

## Constructors

| Constructor                                                                                                                             | Description                                                                   |
| --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [DelegateAutoCleanup(System.Action,System.Type,System.String)](/engine/6000.7/script-reference/unityengine/delegateautocleanup/ctor.md) | Constructor used by the source generator. Don't attempt to use this directly. |

## Static Methods

| Method                                                                                                    | Description                                                                                                                               |
| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [CreateForPlayMode](/engine/6000.7/script-reference/unityengine/delegateautocleanup/createforplaymode.md) | Method used by the source generator to create a cleanup entry registered against the Play mode scope. Don't attempt to use this directly. |
