LocationMeshManager
↳ extends UnityEngine.MonoBehaviour
MonoBehaviour that manages the downloading and rendering of location meshes
Declaration
public class LocationMeshManager : MonoBehaviourProperties
| Name | Type | Summary |
|---|---|---|
| TexturedMeshMaterial | Material | |
| VertexColorMaterial | Material | Get or set the material to use for vertex colored meshes A custom material can be provided to render the meshes with a custom shader |
Fields
| Name | Type | Summary |
|---|---|---|
| static DefaultMaxDecodedSizeKb | uint | Default decoded-size budget of the asset mesh downloads, sized for phones. |
Methods
| Name | Type | Summary |
|---|---|---|
| ConfigureCache | void | Enable or disable the on-disk cache of downloaded mesh data, or change its budget. With the cache enabled, downloaded geometry and textures are kept on disk per chunk. Downloading the same asset again reads the chunks already on disk instead of the network, and an interrupted download resumes where it stopped. The cache is off by default. The Cache Enabled and Cache Max Mb fields in the Inspector apply the same settings when this manager starts. |
| CreateMeshChunk | GameObject | Build a chunk GameObject from geometry yielded by GetLocationMeshChunkDataByVpsMapAssetIdAsync, rendered with this manager's materials. The chunk is the same as one yielded by GetLocationMeshChunksByVpsMapAssetIdAsync. |
| GetLocationMeshChunkDataByVpsMapAssetIdAsync | IAsyncEnumerable<MeshChunkData> | Stream mesh chunks for a VPS map asset like GetLocationMeshChunksByVpsMapAssetIdAsync, but yield each chunk's geometry as MeshChunkData instead of building Unity objects for it. |
| GetLocationMeshChunksByVpsMapAssetIdAsync | IAsyncEnumerable<GameObject> | Stream mesh chunks for a VPS map asset, yielding each chunk as a GameObject as it completes. Resolves the VPS map asset to its Mesh sibling in the same asset group. Chunks arrive one at a time, closest-first based on the provided GPS position. Iterate with await foreach to process each chunk as it arrives. The download stops once the chunks delivered so far occupy maxDecodedSizeKb kilobytes decoded: vertices, UVs, indices and per-vertex colours at 4 bytes each, plus texture bytes as received. Pass 0 for no budget. |
| async GetLocationMeshForPayloadAsync | Task<GameObject> | Get the mesh for an anchor payload |
A custom material can be provided to render the meshes with a custom shader