Exemple #1
0
        public override void OnInspectorGUI()
        {
            if (!Application.isPlaying)
            {
                EditorGUILayout.HelpBox("This info is only available in play mode.", MessageType.Info);
                return;
            }

            var lb = this.target as LoadBalancerPerformanceVisualizer;

            foreach (var d in lb.data)
            {
                EditorGUILayout.LabelField(string.Concat(EditorUtilities.SplitToWords(d.loadBalancerName), " (", d.itemsCount, " items)"));
                EditorGUI.indentLevel++;
                EditorGUILayout.LabelField("Frame Updated Items Count", d.frameUpdatedItemsCount.ToString());
                EditorGUILayout.LabelField("Frame Milliseconds Used", d.frameUpdateMillisecondsUsed.ToString());
                EditorGUILayout.LabelField("Frame Overdue Average", d.frameUpdatesOverdueAverage.ToString("0.###"));

                EditorGUILayout.LabelField("Average Updated Items Count", d.averageUpdatedItemsCount.ToString("0"));
                EditorGUILayout.LabelField("Average Milliseconds Used", d.averageUpdateMillisecondsUsed.ToString("0.###"));
                EditorGUILayout.LabelField("Average Overdue Average", d.averageUpdatesOverdueAverage.ToString("0.###"));
                EditorGUI.indentLevel--;
            }
        }
        public override void OnInspectorGUI()
        {
            if (Application.isPlaying)
            {
                EditorGUILayout.HelpBox("These settings cannot be edited in play mode.", MessageType.Info);
                return;
            }

            var lb = this.target as LoadBalancerComponent;

            foreach (var cfg in lb.configurations)
            {
                bool foldOut = false;
                _foldedOut.TryGetValue(cfg.targetLoadBalancer, out foldOut);
                _foldedOut[cfg.targetLoadBalancer] = EditorGUILayout.Foldout(foldOut, EditorUtilities.SplitToWords(cfg.targetLoadBalancer));
                if (_foldedOut[cfg.targetLoadBalancer])
                {
                    if (DrawConfigEditor(cfg))
                    {
                        EditorUtility.SetDirty(lb);
                    }
                }
            }

            EditorUtilities.Section("Marshaller");
            EditorGUILayout.PropertyField(_mashallerMaxMillisecondPerFrame, new GUIContent("Max Milliseconds Per Frame", "The maximum number of milliseconds per frame to allow for marshalling calls onto the main thread."));
        }