WuhuIslandTesting/Library/PackageCache/com.unity.addressables@1.21.12/Editor/Diagnostics/Profiler/AddressablesProfilerModule.cs

39 lines
1.4 KiB
C#
Raw Permalink Normal View History

2025-01-07 02:06:59 +01:00
#if ENABLE_ADDRESSABLE_PROFILER && UNITY_2021_2_OR_NEWER
using Unity.Profiling;
using Unity.Profiling.Editor;
namespace UnityEditor.AddressableAssets.Diagnostics
{
[System.Serializable]
[ProfilerModuleMetadata("Addressable Assets")]
internal class AddressablesProfilerModule : ProfilerModule
{
private static readonly ProfilerCounterDescriptor[] Descriptors = new ProfilerCounterDescriptor[]
{
new ProfilerCounterDescriptor("Asset Bundles", ProfilerCategory.Loading),
new ProfilerCounterDescriptor("Assets", ProfilerCategory.Loading),
new ProfilerCounterDescriptor("Scenes", ProfilerCategory.Loading),
new ProfilerCounterDescriptor("Catalogs", ProfilerCategory.Loading)
};
private static readonly string[] AutoEnabledCategoryNames = new string[]
{
"Loading",
};
#if UNITY_2022_2_OR_NEWER
public override ProfilerModuleViewController CreateDetailsViewController()
{
return new AddressablesProfilerViewController(ProfilerWindow);
}
#else
public override ProfilerModuleViewController CreateDetailsViewController()
{
return new AddressablesProfilerUnsupported(ProfilerWindow);
}
#endif
public AddressablesProfilerModule() : base(Descriptors, ProfilerModuleChartType.Line, AutoEnabledCategoryNames) {}
}
}
#endif