# UnloadSceneAsyncByNameOrIndex(string, int, bool, UnloadSceneOptions, out bool)

> Override for customizing the behavior of the SceneManager.UnloadSceneAsync function.

## Definition

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

## UnloadSceneAsyncByNameOrIndex(string, int, bool, UnloadSceneOptions, bool)

```csharp
protected virtual AsyncOperation UnloadSceneAsyncByNameOrIndex(string sceneName, int sceneBuildIndex, bool immediately, UnloadSceneOptions options, out bool outSuccess)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): **** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): **** (\[UnloadSceneOptions]\(/engine/6000.7/script-reference/unityengine/scenemanagement/unloadsceneoptions)): **** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)):&#x20;

### Returns

| Type                                                                            | Description |
| ------------------------------------------------------------------------------- | ----------- |
| [AsyncOperation](/engine/6000.7/script-reference/unityengine/asyncoperation.md) |             |
