# CreateForPlayMode(Action, string)

> Method used by the source generator to create a cleanup entry registered against the Play mode scope. Don't attempt to use this directly.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static DelegateAutoCleanup CreateForPlayMode(Action cleanup, string ownerDescription = "")
```

### Parameters

**** (\[Action]\(https\://learn.microsoft.com/dotnet/api/system.action)): **** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)):&#x20;

### Returns

| Type                                                                                      | Description |
| ----------------------------------------------------------------------------------------- | ----------- |
| [DelegateAutoCleanup](/engine/6000.6/script-reference/unityengine/delegateautocleanup.md) |             |
