Version: 2021.2

ProfilerTimeSampleSelection

class in UnityEditor.Profiling

切换到手册

描述

An object describing a selection made in a frame time sample based Profiler module.

Use ProfilerWindow.GetFrameTimeViewSampleSelectionController to get a frame time sample based Profiler module, then use IProfilerFrameTimeSampleSelectionController.selection to get an object describing the current selection. You can create a selection object and set the current selection in a frame time sample based Profiler module via IProfilerFrameTimeSampleSelectionController.SetSelection.

变量

frameIndexThe 0 based frame index. Note that the Profiler Window UI shows the frame index as n+1.
markerNamePathA list of the names of all ProfilerMarkers that make up the Sample Stack of this selection. Unity populates this list on a selection object if it was passed to IProfilerFrameTimeSampleSelectionController.SetSelection and was accepted as a valid selection.
markerPathDepthA shorthand for _markerNamePath.Count. When _markerNamePath is null, this value is 0.
rawSampleIndexThe raw index of a sample, i.e. the index as if would be used with RawFrameDataView and NOT an Item ID as it would be used with HierarchyFrameDataView.
rawSampleIndicesA sample selected in Hierarchy view might correspond to multiple samples in RawFrameDataView. This is a list of all of these sample indices.
sampleDisplayNameThe name of the Sample as it is displayed in the Profiler Window. This might be a shorter version than the last item in _markerNamePath.
threadGroupNameThe name of the group of the thread this sample resides in. When the thread is not part of a thread group, this value is string.empty.
threadIdThe ID of the thread this sample resides in.
threadNameThe name of the thread this sample resides in.

构造函数

ProfilerTimeSampleSelectionConstructs a selection object that can be passed to IProfilerFrameTimeSampleSelectionController.SetSelection to change the selection.