# Understanding SuperScenes data

SuperScenes tries its best to work like magic and allow you to add and remove components with ease. However, if necessary, this page can give you more info on how SuperScenes data is stored, both in editor and at runtime.

## Edit-time data

### SceneDataSO

Components for a given scene are stored in a ScriptableObject of type `SceneDataSO`. Whenever you select a Scene asset to add components, a Scene Data SO is automatically created.

This ScriptableObject stores:

* A reference to the SceneAsset file (only for edit-time)
* The path to this file (for runtime)
* A list of Scene Components

The path cannot be edited, and will be inferred from the Scene asset, and refreshed both when the editor starts, and double-checked when the game builds.

### SceneDataRegistry

All Scene Data SO ScriptableObjects are referenced in another ScriptableObject, of type `SceneDataRegistry`.

This is supposed to exist only in one copy, and will be created for you when the editor starts. This one copy can be accessed using `SceneDataRegistry.Instance` (at both runtime and edit time).

### Data location

In the Unity editor, all the Scene Data SO and the Scene Data Registry ScriptableObjects are kept together in a specific folder. The path to this folder can be customised in **Project Settings > SuperScenes**.

You can customise the path to be anything you want: the data doesn't need to be inside a Resources folder.

{% hint style="warning" %}
If you modify the path and the assets already exist, ensure to move them to the new path before continuing.
{% endhint %}

## Runtime data

At runtime, the key to access the data becomes the Scene Data Registry ScriptableObject. This object is automatically added to the build's [Preloaded assets](https://docs.unity3d.com/6000.1/Documentation/ScriptReference/PlayerSettings.GetPreloadedAssets.html), so there is no action to take on your side.

When the game loads, the ScriptableObject will be loaded into memory before any scene loads. It will then be available to query at any time during the game, using the provided [SuperScenes API](/superscenes/using-superscenes/superscenes-api.md).


---

# 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://tools.continis.io/superscenes/advanced/understanding-superscenes-data.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.
