path | Destination path for the memory snapshot file. |
finishCallback | Event that is fired once the memory snapshot has finished the process of capturing data. |
captureFlags | Flag mask defining the content of the memory snapshot. |
screenshotCallback | Event that you can specify to retrieve a screengrab after the snapshot has finished. |
Triggers a memory snapshot capture.
Request a memory snapshot capture with the provided arguments. Not all fields corresponding to the capture flags are collected. This depends on the target build used to capture the snapshot. In the system, there are two different behaviors of data collection:
* When you call this directly from the Player or in the Editor, the process synchronously creates the memory snapshot file on the host device.Note: This requires that there's no profiling target connected. Meta data collection happens if at least one collection fallback was registered to MemoryProfiler.CreateMetaData. At the end of the process, MemoryProfiler.SnapshotFinished is triggered.
* When you call this in an Editor, and you have connected to a profiling target, the process asynchronously creates the memory snapshot file on the host device and sends the capture request to the remote target. The target device then collects meta data using the callbacks registered to MemoryProfiler.CreateMetaData. You must define the callbacks in the profiling target's local assemblies and register them at run time before you send the capture event. All captured data is streamed to the Editor from the remote target. When the capture process is complete, the snapshot finished callback is triggered inside the Editor. If a screenshot callback was provided during the call, this is called at the end of the current frame.
Note:
* Screenshot callbacks are only called in standalone players or in Play mode.