public static FunctionData Create(ProfilerProperty property)
        {
            var functionData = functionDataAllocator.Allocate();

            functionData.functionPath = property.propertyPath;
            for (int i = 0; i < columns.Length; ++i)
            {
                var column = columns[i];
#if UNITY_5_5_OR_NEWER
                if (column == ProfilerColumn.DontSort)
                {
                    continue;
                }
#endif
                var functionDataValue = FunctionDataValue.Create();
                functionDataValue.column = columnNames[i];
#if UNITY_2019_1_OR_NEWER
                functionDataValue.value = property.GetColumn((int)column);
#else
                functionDataValue.value = property.GetColumn(column);
#endif

                functionData.values[i] = functionDataValue;
            }
            return(functionData);
        }
        private FunctionDataValue GetValue(FunctionData[] framesData, ProfilerColumn column)
        {
            var functionDataValue = new FunctionDataValue {
                column = ProfilerColumnNames[(int)column]
            };
            var getFunctionValue = getFunctionValues[(int)column];

            if (column != ProfilerColumn.GCMemory)
            {
                functionDataValue.value =
                    AggregateValues(framesData.Select(getFunctionValue)).ToString("F2");
            }
            else
            {
                functionDataValue.value =
                    ByteSize.FromBytes(AggregateValues(framesData.Select(getFunctionValue)))
                    .ToString();
            }
            return(functionDataValue);
        }
Exemplo n.º 3
0
        public static FunctionData Create(ProfilerProperty property)
        {
            var functionData = new FunctionData();
            var columns      = Enum.GetValues(typeof(ProfilerColumn));

            functionData.values       = new FunctionDataValue[columns.Length];
            functionData.functionPath = property.propertyPath;
            for (int i = 0; i < columns.Length; ++i)
            {
                var column = (ProfilerColumn)columns.GetValue(i);
#if UNITY_5_5_OR_NEWER
                if (column == ProfilerColumn.DontSort)
                {
                    continue;
                }
#endif
                var functionDataValue = new FunctionDataValue();
                functionDataValue.column = column.ToString();
                functionDataValue.value  = property.GetColumn(column);
                functionData.values[i]   = functionDataValue;
            }
            return(functionData);
        }
Exemplo n.º 4
0
        private FunctionDataValue GetValue(IList <FunctionData> framesData, ProfilerColumn column)
        {
            var functionDataValue = new FunctionDataValue {
                column = ProfilerColumnNames[(int)column]
            };
            var getFunctionValue = getFunctionValues[(int)column];

            for (int i = 0; i < framesData.Count; ++i)
            {
                values.Add(getFunctionValue(framesData[i]));
            }

            if (column != ProfilerColumn.GCMemory)
            {
                functionDataValue.value = AggregateValues(values).ToString("F2");
            }
            else
            {
                functionDataValue.value = ByteSize.FromBytes(AggregateValues(values)).ToString();
            }

            values.Clear();
            return(functionDataValue);
        }