2023-07-16 19:58:37 +02:00
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.Profiling;
|
|
|
|
|
|
|
|
namespace VertexColor.ScenePartition
|
|
|
|
{
|
|
|
|
public static class ProfilerUtility
|
|
|
|
{
|
2023-07-29 16:08:47 +02:00
|
|
|
public struct ProfilerScope : System.IDisposable
|
2023-07-16 19:58:37 +02:00
|
|
|
{
|
|
|
|
public ProfilerScope(string name)
|
|
|
|
{
|
|
|
|
Profiler.BeginSample(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
public ProfilerScope(string name, Object target)
|
|
|
|
{
|
|
|
|
Profiler.BeginSample(name, target);
|
|
|
|
}
|
|
|
|
|
2023-07-29 17:38:55 +02:00
|
|
|
public readonly void Dispose()
|
2023-07-16 19:58:37 +02:00
|
|
|
{
|
|
|
|
Profiler.EndSample();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|