public HairSettingsView(HairMasterNode node) { m_Node = node; PropertySheet ps = new PropertySheet(); int indentLevel = 0; ps.Add(new PropertyRow(CreateLabel("Surface Type", indentLevel)), (row) => { row.Add(new EnumField(SurfaceType.Opaque), (field) => { field.value = m_Node.surfaceType; field.RegisterValueChangedCallback(ChangeSurfaceType); }); }); if (m_Node.surfaceType == SurfaceType.Transparent) { ++indentLevel; ps.Add(new PropertyRow(CreateLabel("Preserve Specular Lighting", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.blendPreserveSpecular.isOn; toggle.OnToggleChanged(ChangeBlendPreserveSpecular); }); }); m_SortPriorityField = new IntegerField(); ps.Add(new PropertyRow(CreateLabel("Sorting Priority", indentLevel)), (row) => { row.Add(m_SortPriorityField, (field) => { field.value = m_Node.sortPriority; field.RegisterValueChangedCallback(ChangeSortPriority); }); }); ps.Add(new PropertyRow(CreateLabel("Receive Fog", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.transparencyFog.isOn; toggle.OnToggleChanged(ChangeTransparencyFog); }); }); ps.Add(new PropertyRow(CreateLabel("Back Then Front Rendering", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.backThenFrontRendering.isOn; toggle.OnToggleChanged(ChangeBackThenFrontRendering); }); }); ps.Add(new PropertyRow(CreateLabel("Transparent Depth Prepass", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.alphaTestDepthPrepass.isOn; toggle.OnToggleChanged(ChangeAlphaTestPrepass); }); }); ps.Add(new PropertyRow(CreateLabel("Transparent Depth Postpass", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.alphaTestDepthPostpass.isOn; toggle.OnToggleChanged(ChangeAlphaTestPostpass); }); }); ps.Add(new PropertyRow(CreateLabel("Transparent Writes Motion Vector", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.transparentWritesMotionVec.isOn; toggle.OnToggleChanged(ChangeTransparentWritesMotionVec); }); }); ps.Add(new PropertyRow(CreateLabel("ZWrite", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.zWrite.isOn; toggle.OnToggleChanged(ChangeZWrite); }); }); if (m_Node.doubleSidedMode == DoubleSidedMode.Disabled) { ps.Add(new PropertyRow(CreateLabel("Cull Mode", indentLevel)), (row) => { row.Add(new EnumField(m_Node.transparentCullMode), (e) => { e.value = m_Node.transparentCullMode; e.RegisterValueChangedCallback(ChangeTransparentCullMode); }); }); } ps.Add(new PropertyRow(CreateLabel("Z Test", indentLevel)), (row) => { row.Add(new EnumField(m_Node.zTest), (e) => { e.value = m_Node.zTest; e.RegisterValueChangedCallback(ChangeZTest); }); }); --indentLevel; } ps.Add(new PropertyRow(CreateLabel("Double-Sided", indentLevel)), (row) => { row.Add(new EnumField(DoubleSidedMode.Disabled), (field) => { field.value = m_Node.doubleSidedMode; field.RegisterValueChangedCallback(ChangeDoubleSidedMode); }); }); ps.Add(new PropertyRow(CreateLabel("Alpha Clipping", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.alphaTest.isOn; toggle.OnToggleChanged(ChangeAlphaTest); }); }); if (m_Node.alphaTest.isOn) { ++indentLevel; ps.Add(new PropertyRow(CreateLabel("Use Shadow Threshold", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.alphaTestShadow.isOn; toggle.OnToggleChanged(ChangeAlphaTestShadow); }); }); --indentLevel; } ps.Add(new PropertyRow(CreateLabel("Receive Decals", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.receiveDecals.isOn; toggle.OnToggleChanged(ChangeDecal); }); }); ps.Add(new PropertyRow(CreateLabel("Receive SSR", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.receiveSSR.isOn; toggle.OnToggleChanged(ChangeSSR); }); }); ps.Add(new PropertyRow(CreateLabel("Geometric Specular AA", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.specularAA.isOn; toggle.OnToggleChanged(ChangeSpecularAA); }); }); ps.Add(new PropertyRow(CreateLabel("Specular Occlusion Mode", indentLevel)), (row) => { row.Add(new EnumField(SpecularOcclusionMode.Off), (field) => { field.value = m_Node.specularOcclusionMode; field.RegisterValueChangedCallback(ChangeSpecularOcclusionMode); }); }); ps.Add(new PropertyRow(CreateLabel("Override Baked GI", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.overrideBakedGI.isOn; toggle.OnToggleChanged(ChangeoverrideBakedGI); }); }); ps.Add(new PropertyRow(CreateLabel("Depth Offset", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.depthOffset.isOn; toggle.OnToggleChanged(ChangeDepthOffset); }); }); ps.Add(new PropertyRow(CreateLabel("Use Light Facing Normal", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.useLightFacingNormal.isOn; toggle.OnToggleChanged(ChangeUseLightFacingNormal); }); }); Add(ps); }
public HairSettingsView(HairMasterNode node) { m_Node = node; PropertySheet ps = new PropertySheet(); int indentLevel = 0; ps.Add(new PropertyRow(CreateLabel("Surface Type", indentLevel)), (row) => { row.Add(new EnumField(SurfaceType.Opaque), (field) => { field.value = m_Node.surfaceType; field.RegisterValueChangedCallback(ChangeSurfaceType); }); }); if (m_Node.surfaceType == SurfaceType.Transparent) { ++indentLevel; ps.Add(new PropertyRow(CreateLabel("Blend Preserves Specular", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.blendPreserveSpecular.isOn; toggle.OnToggleChanged(ChangeBlendPreserveSpecular); }); }); ps.Add(new PropertyRow(CreateLabel("Fog", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.transparencyFog.isOn; toggle.OnToggleChanged(ChangeTransparencyFog); }); }); ps.Add(new PropertyRow(CreateLabel("Back Then Front Rendering", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.backThenFrontRendering.isOn; toggle.OnToggleChanged(ChangeBackThenFrontRendering); }); }); m_SortPiorityField = new IntegerField(); ps.Add(new PropertyRow(CreateLabel("Sort Priority", indentLevel)), (row) => { row.Add(m_SortPiorityField, (field) => { field.value = m_Node.sortPriority; field.RegisterValueChangedCallback(ChangeSortPriority); }); }); --indentLevel; } ps.Add(new PropertyRow(CreateLabel("Alpha Cutoff", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.alphaTest.isOn; toggle.OnToggleChanged(ChangeAlphaTest); }); }); if (m_Node.surfaceType == SurfaceType.Transparent && m_Node.alphaTest.isOn) { ++indentLevel; ps.Add(new PropertyRow(CreateLabel("Alpha Cutoff Depth Prepass", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.alphaTestDepthPrepass.isOn; toggle.OnToggleChanged(ChangeAlphaTestPrepass); }); }); ps.Add(new PropertyRow(CreateLabel("Alpha Cutoff Depth Postpass", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.alphaTestDepthPostpass.isOn; toggle.OnToggleChanged(ChangeAlphaTestPostpass); }); }); ps.Add(new PropertyRow(CreateLabel("Alpha Cutoff Shadow", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.alphaTestShadow.isOn; toggle.OnToggleChanged(ChangeAlphaTestShadow); }); }); --indentLevel; } ps.Add(new PropertyRow(CreateLabel("Double Sided", indentLevel)), (row) => { row.Add(new EnumField(DoubleSidedMode.Disabled), (field) => { field.value = m_Node.doubleSidedMode; field.RegisterValueChangedCallback(ChangeDoubleSidedMode); }); }); ps.Add(new PropertyRow(CreateLabel("Transmission", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.transmission.isOn; toggle.OnToggleChanged(ChangeTransmission); }); }); if (m_Node.surfaceType != SurfaceType.Transparent) { ps.Add(new PropertyRow(CreateLabel("Subsurface Scattering", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.subsurfaceScattering.isOn; toggle.OnToggleChanged(ChangeSubsurfaceScattering); }); }); } ps.Add(new PropertyRow(CreateLabel("Receive Decals", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.receiveDecals.isOn; toggle.OnToggleChanged(ChangeDecal); }); }); ps.Add(new PropertyRow(CreateLabel("Receives SSR", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.receiveSSR.isOn; toggle.OnToggleChanged(ChangeSSR); }); }); ps.Add(new PropertyRow(CreateLabel("Specular AA", indentLevel)), (row) => { row.Add(new Toggle(), (toggle) => { toggle.value = m_Node.specularAA.isOn; toggle.OnToggleChanged(ChangeSpecularAA); }); }); ps.Add(new PropertyRow(CreateLabel("Specular Occlusion Mode", indentLevel)), (row) => { row.Add(new EnumField(SpecularOcclusionMode.Off), (field) => { field.value = m_Node.specularOcclusionMode; field.RegisterValueChangedCallback(ChangeSpecularOcclusionMode); }); }); Add(ps); }