UnityEditor.ProfilerWindow.ProfilerColumnNames C# (CSharp) Method

ProfilerColumnNames() private static method

private static ProfilerColumnNames ( ProfilerColumn columns ) : string[]
columns ProfilerColumn
return string[]
        private static string[] ProfilerColumnNames(ProfilerColumn[] columns)
        {
            string[] names = Enum.GetNames(typeof(ProfilerColumn));
            string[] strArray2 = new string[columns.Length];
            for (int i = 0; i < columns.Length; i++)
            {
                switch (columns[i])
                {
                    case ProfilerColumn.FunctionName:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("Overview");
                        break;

                    case ProfilerColumn.TotalPercent:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("Total");
                        break;

                    case ProfilerColumn.SelfPercent:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("Self");
                        break;

                    case ProfilerColumn.Calls:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("Calls");
                        break;

                    case ProfilerColumn.GCMemory:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("GC Alloc");
                        break;

                    case ProfilerColumn.TotalTime:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("Time ms");
                        break;

                    case ProfilerColumn.SelfTime:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("Self ms");
                        break;

                    case ProfilerColumn.DrawCalls:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("DrawCalls");
                        break;

                    case ProfilerColumn.TotalGPUTime:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("GPU ms");
                        break;

                    case ProfilerColumn.SelfGPUTime:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("Self ms");
                        break;

                    case ProfilerColumn.TotalGPUPercent:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("Total");
                        break;

                    case ProfilerColumn.SelfGPUPercent:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("Self");
                        break;

                    case ProfilerColumn.WarningCount:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("|Warnings");
                        break;

                    case ProfilerColumn.ObjectName:
                        strArray2[i] = LocalizationDatabase.GetLocalizedString("Name");
                        break;

                    default:
                        strArray2[i] = "ProfilerColumn." + names[(int) columns[i]];
                        break;
                }
            }
            return strArray2;
        }

Usage Example

示例#1
0
        private void BuildColumns()
        {
            ProfilerColumn[] array = new ProfilerColumn[]
            {
                ProfilerColumn.FunctionName,
                ProfilerColumn.TotalPercent,
                ProfilerColumn.SelfPercent,
                ProfilerColumn.Calls,
                ProfilerColumn.GCMemory,
                ProfilerColumn.TotalTime,
                ProfilerColumn.SelfTime,
                ProfilerColumn.WarningCount
            };
            ProfilerColumn[] array2 = new ProfilerColumn[]
            {
                ProfilerColumn.ObjectName,
                ProfilerColumn.TotalPercent,
                ProfilerColumn.SelfPercent,
                ProfilerColumn.Calls,
                ProfilerColumn.GCMemory,
                ProfilerColumn.TotalTime,
                ProfilerColumn.SelfTime
            };
            this.m_CPUHierarchyGUI = new ProfilerHierarchyGUI(this, "VisibleProfilerColumnsV2", array, ProfilerWindow.ProfilerColumnNames(array), false, ProfilerColumn.TotalTime);
            this.m_CPUTimelineGUI  = new ProfilerTimelineGUI(this);
            string text = EditorGUIUtility.TextContent("ProfilerColumn.DetailViewObject").text;

            string[] array3 = ProfilerWindow.ProfilerColumnNames(array2);
            array3[0] = text;
            this.m_CPUDetailHierarchyGUI = new ProfilerHierarchyGUI(this, "VisibleProfilerDetailColumns", array2, array3, true, ProfilerColumn.TotalTime);
            ProfilerColumn[] array4 = new ProfilerColumn[]
            {
                ProfilerColumn.FunctionName,
                ProfilerColumn.TotalGPUPercent,
                ProfilerColumn.DrawCalls,
                ProfilerColumn.TotalGPUTime
            };
            ProfilerColumn[] array5 = new ProfilerColumn[]
            {
                ProfilerColumn.ObjectName,
                ProfilerColumn.TotalGPUPercent,
                ProfilerColumn.DrawCalls,
                ProfilerColumn.TotalGPUTime
            };
            this.m_GPUHierarchyGUI = new ProfilerHierarchyGUI(this, "VisibleProfilerGPUColumns", array4, ProfilerWindow.ProfilerColumnNames(array4), false, ProfilerColumn.TotalGPUTime);
            array3    = ProfilerWindow.ProfilerColumnNames(array5);
            array3[0] = text;
            this.m_GPUDetailHierarchyGUI = new ProfilerHierarchyGUI(this, "VisibleProfilerGPUDetailColumns", array5, array3, true, ProfilerColumn.TotalGPUTime);
        }