User defined metadata that provides a description for the memory snapshot.
This propery provides a free form text input method to extend the memory snapshot with extra information such as the context in which the snapshot was taken.
using System; using UnityEngine; using Unity.Profiling.Memory;
public class MemoryProfilerExample : MonoBehaviour { public string levelName = "Default Level Name";
void Start() { MemoryProfiler.CreatingMetadata += CreateMetadata; }
void CreateMetadata(MemorySnapshotMetadata metadata) { metadata.Description = $"This Memory Snapshot capture started at {DateTime.Now} in level {levelName}."; }
void OnDestroy() { MemoryProfiler.CreatingMetadata -= CreateMetadata; } }