void StatGUI()
        {
            EditorGUILayout.BeginVertical("box");
            EditorGUILayout.BeginHorizontal();
            var foldout = EditorUtil.GUILayout.AutoSavedFoldout("DclFoldStat", LabelLocalization.getString(LanguageStringValue.Statistics), true, null);

            if (foldout)
            {
                if (GUILayout.Button(LabelLocalization.getString(LanguageStringValue.Refresh)))
                {
                    sceneMeta.RefreshStatistics();
                }
            }

            EditorGUILayout.EndHorizontal();

            EditorGUI.indentLevel = 1;
            if (foldout)
            {
                GUILayout.Label(LabelLocalization.getString(LanguageStringValue.KeepTheseNumbersSmaller), EditorStyles.centeredGreyMiniLabel);
                var n = sceneMeta.parcels.Count;
                var sceneStatistics = sceneMeta.sceneStatistics;
                StatisticsLineGUI(LabelLocalization.getString(LanguageStringValue.Triangles), sceneStatistics.triangleCount, LimitationConfigs.GetMaxTriangles(n));
                StatisticsLineGUI(LabelLocalization.getString(LanguageStringValue.Bodies), sceneStatistics.bodyCount, LimitationConfigs.GetMaxBodies(n));
                StatisticsLineGUI(LabelLocalization.getString(LanguageStringValue.Entities), sceneStatistics.entityCount, LimitationConfigs.GetMaxTriangles(n));
                StatisticsLineGUI(LabelLocalization.getString(LanguageStringValue.Materials), sceneStatistics.materialCount, LimitationConfigs.GetMaxMaterials(n));
                StatisticsLineGUI(LabelLocalization.getString(LanguageStringValue.Textures), sceneStatistics.textureCount, LimitationConfigs.GetMaxTextures(n));
                StatisticsLineGUI(LabelLocalization.getString(LanguageStringValue.Height), sceneStatistics.maxHeight, LimitationConfigs.GetMaxHeight(n));
            }

            WarningsGUI();
            EditorGUI.indentLevel = 0;
            EditorGUILayout.EndVertical();
        }
예제 #2
0
        void InfoGUI()
        {
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Statistics", EditorStyles.boldLabel, GUILayout.Width(100));
            if (GUILayout.Button("Refresh"))
            {
                sceneStatistics = new SceneStatistics();
                SceneTraverser.TraverseAllScene(null, null, sceneStatistics);
            }
            EditorGUILayout.EndHorizontal();
            GUILayout.Label("Keep these numbers smaller than the right", EditorStyles.centeredGreyMiniLabel);
            var n = sceneMeta.parcels.Count;

            EditorGUILayout.LabelField("Triangles", string.Format("{0} / {1}", sceneStatistics.triangleCount, LimitationConfigs.GetMaxTriangles(n)));
            EditorGUILayout.LabelField("Entities", string.Format("{0} / {1}", sceneStatistics.entityCount, LimitationConfigs.GetMaxTriangles(n)));
            EditorGUILayout.LabelField("Bodies", string.Format("{0} / {1}", sceneStatistics.bodyCount, LimitationConfigs.GetMaxBodies(n)));
            EditorGUILayout.LabelField("Height", string.Format("{0} / {1}", sceneStatistics.maxHeight, LimitationConfigs.GetMaxHeight(n)));
        }