Пример #1
0
        public void OpenMarkerInCpuModule(long frameIndex, string threadGroupName, string threadName, ulong threadId, int threadIndex, int sampleIndex)
        {
            GetProfiler();
            if (frameIndex < m_ProfilerWindow.firstAvailableFrameIndex || frameIndex > m_ProfilerWindow.lastAvailableFrameIndex)
            {
                Debug.Log($"Frame index {frameIndex} out of range ({m_ProfilerWindow.firstAvailableFrameIndex} - { m_ProfilerWindow.lastAvailableFrameIndex}");
                return;
            }
            m_ProfilerWindow.selectedModule = m_ProfilerWindow.GetProfilerModuleByType <CPUProfilerModule>();
            var cpuModule = m_ProfilerWindow.selectedModule as CPUOrGPUProfilerModule;

            cpuModule.ViewType = ProfilerViewType.Timeline;
            m_CpuProfilerModule.SetSelection(new ProfilerTimeSampleSelection(frameIndex, threadGroupName, threadName, threadId, sampleIndex));
            // m_CpuProfilerModule.focusedThreadIndex = (int)threadIndex; // I'm hoping this could autoexpand but currently gives a null ref exception
        }