ProfilerModuleMetadataAttribute.IconPath
Declaration
public string IconPath;Описание
Путь к значку модуля Profiler.
Unity отображает a Profiler значок модуля рядом с его именем в Profiler Рекомендуемый размер значка в указанном пути составляет 16x16 пикселей. Чтобы предоставить значок Retina, используйте суффикс “@2x”, как показано в примере ниже. Чтобы предоставить значок темного режима, используйте префикс “d_”, как показано в примере ниже. Если вы работаете в пакете, используйте схема пути пакета для ссылки на иконку.
Строка. Только для чтения.
// With the following icons present in the Assets/Icons directory of the project and an icon path of "Assets/Icons/GarbageCollectionIcon.png", Unity will load the appropriate icon depending upon the context. // - Assets/Icons/GarbageCollectionIcon.png // 16 x 16 Standard Light Mode Icon // - Assets/Icons/GarbageCollectionIcon@2x.png // 32 x 32 Retina Light Mode Icon // - Assets/Icons/d_GarbageCollectionIcon.png // 16 x 16 Standard Dark Mode Icon // - Assets/Icons/d_GarbageCollectionIcon@2x.png // 32 x 32 Retina Dark Mode Icon
using System; using Unity.Profiling; using Unity.Profiling.Editor;
[Serializable] [ProfilerModuleMetadata("Garbage Collection", IconPath = "Assets/Icons/GarbageCollectionIcon.png")] public class GarbageCollectionProfilerModule : ProfilerModule { static readonly ProfilerCounterDescriptor[] k_ChartCounters = new ProfilerCounterDescriptor[] { new ProfilerCounterDescriptor("GC Reserved Memory", ProfilerCategory.Memory), new ProfilerCounterDescriptor("GC Used Memory", ProfilerCategory.Memory), new ProfilerCounterDescriptor("GC Allocated In Frame", ProfilerCategory.Memory), };
public GarbageCollectionProfilerModule() : base(k_ChartCounters) {} }
Дополнительные ресурсы: ,ProfilerModule,.