Example #1
0
        bool IsActive(DebugUI.Table table, int index, GameObject child)
        {
            if (!table.GetColumnVisibility(index))
            {
                return(false);
            }

            var valueChild = child.transform.Find("Value");

            if (valueChild != null && valueChild.TryGetComponent <Text>(out var text))
            {
                return(!string.IsNullOrEmpty(text.text));
            }

            return(true);
        }
Example #2
0
        static void LoadDebugPanel()
        {
            var d    = DebugManager.instance;
            var list = new List <DebugUI.Widget>();

            // TODO: actual useful information: GPU/CPU time, update count per second, ect.

            // First row for volume info
            float timer = 0.0f, refreshRate = 0.2f;
            var   table = new DebugUI.Table()
            {
                displayName = "Graph Name", isReadOnly = true
            };

            foreach (var kp in MixtureGraphProcessor.processorInstances)
            {
                var graph      = kp.Key;
                var processors = kp.Value;

                var row = new DebugUI.Table.Row()
                {
                    displayName = String.IsNullOrEmpty(graph.name) ? "(No Name)" : graph.name,
                };

                row.children.Add(new DebugUI.Value {
                    displayName = "Processor Count", getter = () => processors.Count.ToString()
                });
                row.children.Add(new DebugUI.Value {
                    displayName = "Update Count", getter = () => graph.mainOutputTexture.updateCount
                });
                // Last Processing Time GPU
                row.children.Add(new DebugUI.Value {
                    displayName = "GPU Time (ms)", getter = () => (graph.outputNode as OutputNode).processingTimeInMillis
                });

                table.children.Add(row);
            }

            if (MixtureGraphProcessor.processorInstances.Count == 0)
            {
                list.Add(new DebugUI.Value {
                    displayName = "Graph List", getter = () => {
                        if (Time.time - timer < refreshRate)
                        {
                            return("");
                        }
                        timer = Time.time;

                        return("No Mixture Currently In Use");
                    }
                });
            }
            else
            {
                list.Add(table);
            }

            var panel = DebugManager.instance.GetPanel(mixturePanel, true);

            panel.flags = DebugUI.Flags.None;
            panel.children.Add(list.ToArray());
            mixtureDebugItems = list.ToArray();
        }