Through this class, you can obtain various values from the Profiler function.
| API | Description |
|---|
| SetMemoryProfilingType(profilingType) | Specifies the memory measurement type. |
| SetGCCollectCallbacks(callbacks) | Configure the events to execute when the [Force GC Collect] button is pressed by creating a custom class and passing it as an argument. For detailed information about the argument, please refer to NoaGCCollectCallbacks. |
| SetUnloadAssetsCallbacks(callbacks) | Configure the events to execute when the [Unload Unused Assets] button is pressed by creating a custom class and passing it as an argument. For detailed information about the argument, please refer to NoaUnloadAssetsCallbacks. |
| API | Description |
|---|
| ProfilerInfo | Returns the stored Profiler information. If it is in an unmeasured state, the initial value will be entered. |
| LatestFpsInfo | Returns the latest FPS information that was measured. If it is in an unmeasured state, the initial value will be entered. |
| LatestMemoryInfo | Returns the latest Memory information that was measured. If it is in an unmeasured state or if it is in an environment where values cannot be obtained, the initial value will be entered. |
| LatestRenderingInfo | Returns the latest Rendering information that was measured. If it is in an unmeasured state, the initial value will be entered. |
| IsFpsProfiling | Returns the current FPS measurement status. You can change the measurement status from this property. |
| IsMemoryProfiling | Returns the current Memory measurement status. You can change the measurement status from this property. |
| TotalNativeMemoryMB | Returns the maximum memory capacity to be measured. You can specify the maximum memory capacity to be measured from this property when the measurement type is set to Native Memory. If a negative value is specified, it will be the RAM capacity of the device. |
| IsRenderingProfiling | Returns the current Rendering measurement status. You can change the measurement status from this property. |
#if NOA_DEBUGGER
using NoaDebugger;
#endif
public class Example
{
void ExampleMethod()
{
#if NOA_DEBUGGER
ProfilerInfo profilerInfo = NoaProfiler.ProfilerInfo;
FpsInfo fpsInfo = NoaProfiler.LatestFpsInfo;
MemoryInfo memoryInfo = NoaProfiler.LatestMemoryInfo;
RenderingInfo renderingInfo = NoaProfiler.LatestRenderingInfo;
bool isFpsProfiling = NoaProfiler.IsFpsProfiling;
NoaProfiler.IsFpsProfiling = false;
NoaProfiler.SetMemoryProfilingType(NoaProfiler.MemoryProfilingType.Native);
NoaProfiler.TotalNativeMemoryMB = 8192.0f;
var gcCollector = new ExampleGCCollector();
NoaProfiler.SetGCCollectCallbacks(gcCollector);
var assetUnloader = new ExampleAssetUnloader();
NoaProfiler.SetUnloadAssetsCallbacks(assetUnloader);
#endif
}
}