Exemple #1
0
        internal DebugHandler(ScriptableRendererData scriptableRendererData)
        {
            Shader debugReplacementShader = scriptableRendererData.debugShaders.debugReplacementPS;

            m_DebugDisplaySettings = DebugDisplaySettings.Instance;

            m_ReplacementMaterial = (debugReplacementShader == null) ? null : CoreUtils.CreateEngineMaterial(debugReplacementShader);
        }
        public void RegisterDebug(DebugDisplaySettings settings)
        {
            DebugManager debugManager = DebugManager.instance;
            List <IDebugDisplaySettingsPanelDisposable> panels = new List <IDebugDisplaySettingsPanelDisposable>();

            debugManager.RegisterData(this);

            m_Settings         = settings;
            m_DisposablePanels = panels;

            Action <IDebugDisplaySettingsData> onExecute = (data) =>
            {
                IDebugDisplaySettingsPanelDisposable disposableSettingsPanel = data.CreatePanel();
                DebugUI.Widget[] panelWidgets = disposableSettingsPanel.Widgets;
                string           panelId      = disposableSettingsPanel.PanelName;
                DebugUI.Panel    panel        = debugManager.GetPanel(panelId, true);
                ObservableList <DebugUI.Widget> panelChildren = panel.children;

                panels.Add(disposableSettingsPanel);
                panelChildren.Add(panelWidgets);
            };

            m_Settings.ForEach(onExecute);
        }