NoaDebuggerNoaDebugger
  • v1.6.0
  • v1.5.0
  • v1.4.0
  • v1.3.0
  • v1.2.0
  • v1.1.0
  • v1.0.0
Demo
Contact
Buy
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • v1.6.0
  • v1.5.0
  • v1.4.0
  • v1.3.0
  • v1.2.0
  • v1.1.0
  • v1.0.0
Demo
Contact
Buy
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • NoaProfiler

NoaProfiler

Through this class, you can obtain various values from the Profiler function.

APIs

Static Methods

APIDescription
SetMemoryProfilingType(profilingType)Specifies the memory measurement type.

Static Properties

APIDescription
ProfilerInfoReturns the stored Profiler information. If it is in an unmeasured state, the initial value will be entered.
LatestFpsInfoReturns the latest FPS information that was measured. If it is in an unmeasured state, the initial value will be entered.
LatestMemoryInfoReturns 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.
LatestRenderingInfoReturns the latest Rendering information that was measured. If it is in an unmeasured state, the initial value will be entered.
IsFpsProfilingReturns the current FPS measurement status. You can change the measurement status from this property.
IsMemoryProfilingReturns the current Memory measurement status. You can change the measurement status from this property.
TotalNativeMemoryMBReturns 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.
IsRenderingProfilingReturns the current Rendering measurement status. You can change the measurement status from this property.
OnGcCollectThis event is triggered when the [Force GC Collect] button is pressed.
If the event handler returns true, garbage collection will be executed. If the event handler returns false, garbage collection will not be executed.
OnUnloadAssetsThis event is triggered when the [Unload Unused Assets] button is pressed.
If the event handler returns true, asset unloading will be executed. If the event handler returns false, asset unloading will not be executed.

Sample Code

#if NOA_DEBUGGER
using NoaDebugger;
#endif

public class Example
{
    void ExampleMethod()
    {
#if NOA_DEBUGGER

        // Get the profiler information.
        ProfilerInfo profilerInfo = NoaProfiler.ProfilerInfo;

        // Get various measurement information.
        FpsInfo fpsInfo = NoaProfiler.LatestFpsInfo;
        MemoryInfo memoryInfo = NoaProfiler.LatestMemoryInfo;
        RenderingInfo renderingInfo = NoaProfiler.LatestRenderingInfo;

        // Get and set the measurement status.
        bool isFpsProfiling = NoaProfiler.IsFpsProfiling;
        NoaProfiler.IsFpsProfiling = false;

        // Specify the maximum memory capacity to measure when switched to Native Memory (in MB).
        NoaProfiler.SetMemoryProfilingType(NoaProfiler.MemoryProfilingType.Native);
        NoaProfiler.TotalNativeMemoryMB = 8192.0f;

        // Set the event triggered when the [Force GC Collect] button is pressed.
        NoaProfiler.OnGcCollect += () =>
        {
            Debug.Log("GC collect.");
            // Return true to allow garbage collection, false to deny.
            return true;
        };

        // Set the event triggered when the [Unload Unused Assets] button is pressed.
        NoaProfiler.OnUnloadAssets += () =>
        {
            Debug.Log("Unload unused assets.");
            // Return true to allow asset unloading, false to deny.
            return true;
        };

#endif
    }
}