# SceneUnloadData

## General

When unloading scenes information on what to unload is constructed within the SceneUnloadData class. SceneUnloadData is very similar to SceneLoadData. The API for SceneUnloadData can be found [here](https://fish-networking.com/FishNet/api/api/FishNet.Managing.Scened.SceneUnloadData.html).

## Default values

```csharp
SceneUnloadData sud = new SceneUnloadData()
{
    SceneLookupDatas = new SceneLookupData[0],
    Params = new UnloadParams()
    {
        ServerParams = new object[0],
        ClientParams = new byte[0]
    },
    Options = new UnloadOptions()
    {
        Mode = ServerUnloadMode.UnloadUnused,
        Addressables = false
    }
};
```

<details>

<summary>SceneLookupDatas</summary>

This Array is populated with the scenes you want to unload, depending on the parameters you pass into the SceneUnloadData when constructed.

See [**Unloading Scenes**](/docs/guides/features/scene-management/unloading-scenes.md) for examples.

</details>

<details>

<summary>Params</summary>

Params are an optional way to assign data to your scene loads/unloads. This data will be available within[ **Scene Events**](/docs/guides/features/scene-management/scene-events.md), Information used in Params can be useful for storing information about the scene load/unload and referencing it later when the scene load/unload completes.

**ServerParams**

*ServerParams* are only included on the server side and are not networked. It is an array of objects, meaning you can send anything you want. However when accessing the Params through event args, you will have to cast the object to the data you want.

**ClientParams**

*ClientParams* is a byte array which may contain anything. It will be sent to clients when they receive the load scene instructions. Clients can access the *ClientParams* within the scene change events.

</details>

<details>

<summary>Options</summary>

Like with Options in loading, the UnloadOptions offer additional settings when unloading.

**Mode**

These values will override the AutomaticallyUnload Option that was used when loaded the scene. If you set *AutomaticallyUnload* to false but specified *ServerUnloadModes.UnloadUnused* then the scene would be unloaded when emptied.

**ServerUnloadModes.UnloadUnused**

* This is the default setting which will only unload a scene which is no longer used.

**ServerUnloadModes.KeepUnused**

* This option will keep the scene loaded on the server if all clients have been removed. See [**Scene Caching**](/docs/guides/features/scene-management/scene-caching.md) for more details

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fish-networking.gitbook.io/docs/guides/features/scene-management/scene-data/sceneunloaddata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
