指向附带属性的 Profiler 模块的图标的路径。
Unity 在 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/[email protected] // 32 x 32 Retina Light Mode Icon // - Assets/Icons/d_GarbageCollectionIcon.png // 16 x 16 Standard Dark Mode Icon // - Assets/Icons/[email protected] // 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。