Exemple #1
0
        // Token: 0x060003CE RID: 974 RVA: 0x00033C08 File Offset: 0x00031E08
        private void DrawUsageInfo(TextureMemoryUsageInfo usageInfo, string title)
        {
            float num  = 80f;
            float num2 = 65f;
            float num3 = 120f;
            float num4 = 50f;

            EditorGUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayout.Label(title, EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUILayout.Space(2f);
            if (usageInfo.UsagePerType.Count > 0)
            {
                float num5 = 1f / usageInfo.UsagePerType[0].Percentage;
                foreach (TextureMemoryUsageData textureMemoryUsageData in usageInfo.UsagePerType)
                {
                    EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
                    GUILayout.Label(TextureUtil2.GetTextureTypeString(textureMemoryUsageData.TextureType, textureMemoryUsageData.TextureShape), new GUILayoutOption[]
                    {
                        GUILayout.Width(num)
                    });
                    GUILayout.Label(EditorUtility2.FormatBytes(textureMemoryUsageData.Size), GUIStyles.LabelRight, new GUILayoutOption[]
                    {
                        GUILayout.Width(num2)
                    });
                    Color color = GUIColors.TintIfPlaying(TextureUtil2.GetTextureImporterTypeChartColor(textureMemoryUsageData.TextureType, textureMemoryUsageData.TextureShape));
                    EditorGUI.DrawRect(GUILayoutUtility.GetRect(1f, 19f, new GUILayoutOption[]
                    {
                        GUILayout.Width(Mathf.Max(1f, textureMemoryUsageData.Percentage * num3 * num5))
                    }), color);
                    GUILayout.Label(string.Format("{0:F1}%", textureMemoryUsageData.Percentage * 100f), new GUILayoutOption[]
                    {
                        GUILayout.Width(num4)
                    });
                    EditorGUILayout.EndHorizontal();
                    GUILayout.Space(1f);
                }
            }
            GUILayout.Label(string.Format("= {0}", EditorUtility2.FormatBytes(usageInfo.TotalSize)), GUIStyles.BoldLabelRight, new GUILayoutOption[]
            {
                GUILayout.Width(8f + num + num2)
            });
            EditorGUILayout.EndVertical();
        }