# Runtime

## Method Calls

* ScansInfoLoader.FetchAndWrapUserScansAsync
* ScansInfoLoader.FetchAndWrapPublicScansAsync
* ScanLoader.InstantiateScanAsync

## Events

* ScansInfoLoader.OnInfoLoaded  (user's scans)
* ScansInfoLoader.OnPublicInfoLoaded  (all public scans)
* ScansInfoLoader.OnInfoFailed
* ScanLoader.OnScanLoaded
* ScanLoader.OnScanFailed
* ScanLoader.OnScanDestroyed

## Getting Started

The easiest way to get started is to import the **Auto and Scan Import** sample into your Unity project. Go to `Windows > Package Manager > MeshMap Unity SDK > Samples`.

Make sure to [configure your app API key in the MeshMap Hub](/unity-sdk/core.md#api-key).

#### Features

* A simple user flow for loading user scans and all public scans.
  * The player needs to be connected to their MeshMap account (see [Auth - Runtime](/unity-sdk/core/auth/runtime.md)).
* Import any scan with a supported file type (.gltf/.glb) and load it to the active scene.
* Optionally, add a `NavMeshModifier` to the scan model and rebuild the `NavMeshSurface` in the scene.
* Destroy the previous scan from the scene when importing a new scan.

#### Components

<table><thead><tr><th width="226.00006103515625">Class</th><th>Description</th></tr></thead><tbody><tr><td><a href="https://github.com/MeshMap/com.meshmap.sdk.core/blob/main/Runtime/API/Scans/ScansInfoLoader.cs"><code>ScansInfoLoader</code></a></td><td>Handles loading scan information asynchronously from the MeshMap Scans API.</td></tr><tr><td><a href="https://github.com/MeshMap/com.meshmap.sdk.core/blob/main/Samples~/AuthAndScanImport/Scripts/Scans/ScanListingUI.cs"><code>ScanListingUI</code></a></td><td>Displays metadata for a single scan entry in the UI, including its name, location, and user information.</td></tr><tr><td><a href="https://github.com/MeshMap/com.meshmap.sdk.core/blob/main/Samples~/AuthAndScanImport/Scripts/Scans/ScanLoader.cs"><code>ScanLoader</code></a></td><td>Demonstrates loading, instantiation, and cleanup of scan models in the active scene.</td></tr><tr><td><a href="https://github.com/MeshMap/com.meshmap.sdk.core/blob/main/Samples~/AuthAndScanImport/Scripts/Scans/ScansUI.cs"><code>ScansUI</code></a></td><td>Demonstrates UI logic for listing, paginating, filtering, and loading scans from the MeshMap API. Provides controls to request user or public scans, validate pagination input, and display scan listings dynamically.</td></tr><tr><td><a href="https://github.com/MeshMap/com.meshmap.sdk.core/blob/main/Samples~/AuthAndScanImport/Scripts/Scans/NavMesh/BuildNavMeshAtRuntime.cs"><code>BuildNavMeshAtRuntime</code></a></td><td>Automatically builds or clears <code>NavMesh</code> data at runtime when a scan is loaded or destroyed.</td></tr></tbody></table>


---

# 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://docs.meshmap.com/unity-sdk/core/scans/runtime.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.
