void RegisterDebug() { var widgetList = new List <DebugUI.Widget>(); widgetList.Add(new DebugUI.BoolField { displayName = "Display Cells", getter = () => debugDisplay.drawCells, setter = value => debugDisplay.drawCells = value }); widgetList.Add(new DebugUI.BoolField { displayName = "Display Bricks", getter = () => debugDisplay.drawBricks, setter = value => debugDisplay.drawBricks = value }); widgetList.Add(new DebugUI.BoolField { displayName = "Display Probes", getter = () => debugDisplay.drawProbes, setter = value => debugDisplay.drawProbes = value, onValueChanged = RefreshDebug }); if (debugDisplay.drawProbes) { var probeContainer = new DebugUI.Container(); probeContainer.children.Add(new DebugUI.EnumField { displayName = "Probe Shading Mode", getter = () => (int)debugDisplay.probeShading, setter = value => debugDisplay.probeShading = (DebugProbeShadingMode)value, autoEnum = typeof(DebugProbeShadingMode), getIndex = () => (int)debugDisplay.probeShading, setIndex = value => debugDisplay.probeShading = (DebugProbeShadingMode)value, onValueChanged = RefreshDebug }); probeContainer.children.Add(new DebugUI.FloatField { displayName = "Probe Size", getter = () => debugDisplay.probeSize, setter = value => debugDisplay.probeSize = value, min = () => 0.1f, max = () => 10.0f }); if (debugDisplay.probeShading == DebugProbeShadingMode.SH) { probeContainer.children.Add(new DebugUI.FloatField { displayName = "Probe Exposure Compensation", getter = () => debugDisplay.exposureCompensation, setter = value => debugDisplay.exposureCompensation = value }); } widgetList.Add(probeContainer); } widgetList.Add(new DebugUI.FloatField { displayName = "Culling Distance", getter = () => debugDisplay.cullingDistance, setter = value => debugDisplay.cullingDistance = value, min = () => 0.0f }); m_DebugItems = widgetList.ToArray(); var panel = DebugManager.instance.GetPanel("Probe Volume", true); panel.children.Add(m_DebugItems); }
void RegisterDebug() { var widgetList = new List <DebugUI.Widget>(); var subdivContainer = new DebugUI.Container() { displayName = "Subdivision Visualization" }; subdivContainer.children.Add(new DebugUI.BoolField { displayName = "Display Cells", getter = () => debugDisplay.drawCells, setter = value => debugDisplay.drawCells = value, onValueChanged = RefreshDebug }); subdivContainer.children.Add(new DebugUI.BoolField { displayName = "Display Bricks", getter = () => debugDisplay.drawBricks, setter = value => debugDisplay.drawBricks = value, onValueChanged = RefreshDebug }); if (debugDisplay.drawCells || debugDisplay.drawBricks) { subdivContainer.children.Add(new DebugUI.FloatField { displayName = "Culling Distance", getter = () => debugDisplay.subdivisionViewCullingDistance, setter = value => debugDisplay.subdivisionViewCullingDistance = value, min = () => 0.0f }); } var probeContainer = new DebugUI.Container() { displayName = "Probe Visualization" }; probeContainer.children.Add(new DebugUI.BoolField { displayName = "Display Probes", getter = () => debugDisplay.drawProbes, setter = value => debugDisplay.drawProbes = value, onValueChanged = RefreshDebug }); if (debugDisplay.drawProbes) { probeContainer.children.Add(new DebugUI.EnumField { displayName = "Probe Shading Mode", getter = () => (int)debugDisplay.probeShading, setter = value => debugDisplay.probeShading = (DebugProbeShadingMode)value, autoEnum = typeof(DebugProbeShadingMode), getIndex = () => (int)debugDisplay.probeShading, setIndex = value => debugDisplay.probeShading = (DebugProbeShadingMode)value, onValueChanged = RefreshDebug }); probeContainer.children.Add(new DebugUI.FloatField { displayName = "Probe Size", getter = () => debugDisplay.probeSize, setter = value => debugDisplay.probeSize = value, min = () => 0.1f, max = () => 10.0f }); if (debugDisplay.probeShading == DebugProbeShadingMode.SH) { probeContainer.children.Add(new DebugUI.FloatField { displayName = "Probe Exposure Compensation", getter = () => debugDisplay.exposureCompensation, setter = value => debugDisplay.exposureCompensation = value }); } probeContainer.children.Add(new DebugUI.FloatField { displayName = "Culling Distance", getter = () => debugDisplay.probeCullingDistance, setter = value => debugDisplay.probeCullingDistance = value, min = () => 0.0f }); probeContainer.children.Add(new DebugUI.IntField { displayName = "Max subdivision displayed", getter = () => debugDisplay.maxSubdivToVisualize, setter = (v) => debugDisplay.maxSubdivToVisualize = Mathf.Min(v, ProbeReferenceVolume.instance.GetMaxSubdivision()), min = () => 0, max = () => ProbeReferenceVolume.instance.GetMaxSubdivision(), }); } widgetList.Add(subdivContainer); widgetList.Add(probeContainer); m_DebugItems = widgetList.ToArray(); var panel = DebugManager.instance.GetPanel("Probe Volume", true); panel.children.Add(m_DebugItems); }