static UniversalGlobalSettingsPanelIMGUI()
 {
     Inspector = CED.Group(
         LightLayerNamesSection,
         MiscSection
         );
 }
Exemplo n.º 2
0
 static InfluenceVolumeUI()
 {
     SectionFoldoutShapePlanar = CED.Group(
         CED.FoldoutGroup(
             influenceVolumeHeader,
             (s, d, o) => s.isSectionExpandedShape,
             FoldoutOption.Indent,
             CED.Action(Drawer_InfluenceAdvancedSwitch),
             CED.space,
             CED.Action(Drawer_FieldShapeType),
             CED.FadeGroup(
                 (s, d, o, i) => s.IsSectionExpanded_Shape((InfluenceShape)i),
                 FadeOption.None,
                 SectionShapeBoxPlanar,
                 SectionShapeSpherePlanar
                 )
             )
         );
     SectionFoldoutShape = CED.Group(
         CED.FoldoutGroup(
             influenceVolumeHeader,
             (s, d, o) => s.isSectionExpandedShape,
             FoldoutOption.Indent,
             CED.Action(Drawer_InfluenceAdvancedSwitch),
             CED.space,
             CED.Action(Drawer_FieldShapeType),
             CED.FadeGroup(
                 (s, d, o, i) => s.IsSectionExpanded_Shape((InfluenceShape)i),
                 FadeOption.None,
                 SectionShapeBox,
                 SectionShapeSphere
                 )
             )
         );
 }
        static InfluenceVolumeUI()
        {
            SectionShape = CED.Group(
                CED.Action(Drawer_FieldShapeType),
                CED.FadeGroup(
                    (s, d, o, i) => s.IsSectionExpanded_Shape((ShapeType)i),
                    FadeOption.Indent,
                    SectionShapeBox,
                    SectionShapeSphere
                    )
                );

            SectionFoldoutShape = CED.Group(
                CED.FoldoutGroup(
                    "Influence Volume",
                    (s, d, o) => s.isSectionExpandedShape,
                    FoldoutOption.Indent,
                    CED.Action(Drawer_FieldShapeType),
                    CED.FadeGroup(
                        (s, d, o, i) => s.IsSectionExpanded_Shape((ShapeType)i),
                        FadeOption.None,
                        SectionShapeBox,
                        SectionShapeSphere
                        )
                    )
                );
        }
        static PlanarReflectionProbeUI()
        {
            SectionFoldoutCaptureSettings = CED.FoldoutGroup(
                "Capture Settings",
                (s, d, o) => s.isSectionExpandedCaptureSettings,
                FoldoutOption.Indent,
                CED.Action(Drawer_SectionCaptureSettings),
                CED.FadeGroup(
                    (s, d, o, i) =>
            {
                switch (i)
                {
                default:
                case 0: return(s.isSectionExpandedCaptureMirrorSettings);

                case 1: return(s.isSectionExpandedCaptureStaticSettings);
                }
            },
                    FadeOption.None,
                    SectionCaptureMirrorSettings,
                    SectionCaptureStaticSettings)
                );

            SectionProbeModeSettings = CED.Group(
                CED.Action(Drawer_FieldCaptureType),
                CED.FadeGroup(
                    (s, d, o, i) => s.IsSectionExpandedReflectionProbeMode((ReflectionProbeMode)i),
                    FadeOption.Indent,
                    SectionProbeModeBakedSettings,
                    SectionProbeModeRealtimeSettings,
                    SectionProbeModeCustomSettings
                    )
                );

            Inspector = CED.Group(
                //SectionProbeModeSettings,
                CED.space,
                CED.Action((s, d, o) => EditorGUILayout.LabelField(_.GetContent("Proxy Volume"), EditorStyles.boldLabel)),
                CED.Action(Drawer_FieldProxyVolumeReference),
                CED.space,
                CED.Action(Drawer_Toolbar),
                CED.space,
                CED.Select(
                    (s, d, o) => s.influenceVolume,
                    (s, d, o) => d.influenceVolume,
                    InfluenceVolumeUI.SectionFoldoutShape
                    ),
                CED.Action(Drawer_DifferentShapeError),
                SectionFoldoutInfluenceSettings,
                SectionFoldoutCaptureSettings,
                CED.Select(
                    (s, d, o) => s.frameSettings,
                    (s, d, o) => d.frameSettings,
                    FrameSettingsUI.Inspector
                    ),
                CED.space,
                CED.Action(Drawer_SectionBakeButton)
                );
        }
 static ReflectionProxyVolumeComponentUI()
 {
     Inspector = CED.Select(
         (s, d, o) => s.proxyVolume,
         (s, d, o) => d.proxyVolume,
         ProxyVolumeUI.SectionShape
         );
 }
Exemplo n.º 6
0
 static HDRaytracingEnvironmentInspector()
 {
     Inspector = CED.Group(CED.FoldoutGroup(Styles.genericSectionText, Expandable.Generic, k_ExpandedState, GenericSubMenu),
                           CED.FoldoutGroup(Styles.aoSectionText, Expandable.AmbientOcclusion, k_ExpandedState, AmbientOcclusionSubMenu),
                           CED.FoldoutGroup(Styles.reflSectionText, Expandable.Reflection, k_ExpandedState, ReflectionsSubMenu),
                           CED.FoldoutGroup(Styles.shadowSectionText, Expandable.AreaShadow, k_ExpandedState, AreaShadowSubMenu),
                           CED.FoldoutGroup(Styles.primaryRaytracingSectionText, Expandable.PrimaryRaytracing, k_ExpandedState, RaytracingSubMenu),
                           CED.FoldoutGroup(Styles.indirectDiffuseSectionText, Expandable.IndirectDiffuse, k_ExpandedState, IndirectDiffuseSubMenu));
 }
Exemplo n.º 7
0
 static ProxyVolumeUI()
 {
     SectionShape = CED.Group(
         CED.Action(Drawer_FieldShapeType),
         CED.FadeGroup(
             (s, d, o, i) => s.IsSectionExpanded_Shape((InfluenceShape)i),
             FadeOption.Indent,
             SectionShapeBox,
             SectionShapeSphere
             )
         );
 }
Exemplo n.º 8
0
 static HDProbeUI()
 {
     SectionProbeModeSettings = CED.Group(
         CED.Action(Drawer_FieldCaptureType),
         CED.FadeGroup(
             (s, d, o, i) => s.IsSectionExpandedReflectionProbeMode((ReflectionProbeMode)i),
             FadeOption.Indent,
             SectionProbeModeBakedSettings,
             SectionProbeModeRealtimeSettings
             )
         );
 }
Exemplo n.º 9
0
 static ProxyVolumeUI()
 {
     SectionShape = CED.Group(
         CED.Action(Drawer_FieldShapeType),
         CED.FadeGroup(
             (s, d, o, i) => s.IsSectionExpanded_Shape((ShapeType)i),
             true,
             SectionShapeBox,
             SectionShapeSphere
             )
         );
 }
Exemplo n.º 10
0
#pragma warning restore 618

        static ProxyVolumeUI()
        {
            SectionShape = CED.Group(
                CED.Action(Drawer_FieldShapeType),
                CED.FadeGroup(
                    (s, d, o, i) => s.IsSectionExpanded_Shape((InfluenceShape)i),
#pragma warning disable 618
                    FadeOption.Indent,
#pragma warning restore 618
                    SectionShapeBox,
                    SectionShapeSphere
                    )
                );
        }
Exemplo n.º 11
0
 static DefaultSettingsPanelIMGUI()
 {
     Inspector = CED.Group(
         VolumeSection,
         CED.Group((serialized, owner) => EditorGUILayout.Space()),
         DiffusionProfileSettingsSection,
         CED.Group((serialized, owner) => EditorGUILayout.Space()),
         FrameSettingsSection,
         CED.Group((serialized, owner) => EditorGUILayout.Space()),
         LayerNamesSection,
         CED.Group((serialized, owner) => EditorGUILayout.Space()),
         CustomPostProcessesSection,
         CED.Group((serialized, owner) => EditorGUILayout.Space()),
         MiscSection,
         CED.Group((serialized, owner) => EditorGUILayout.Space()),
         ResourcesSection
         );
 }
        static HDLightUI()
        {
            Inspector = CED.Group(
                CED.AdvancedFoldoutGroup(s_Styles.generalHeader, Expandable.General, k_ExpandedState,
                    (serialized, owner) => GetAdvanced(Advanceable.General, serialized, owner),
                    (serialized, owner) => SwitchAdvanced(Advanceable.General, serialized, owner),
                    DrawGeneralContent,
                    DrawGeneralAdvancedContent
                    ),
                CED.AdvancedFoldoutGroup(s_Styles.shapeHeader, Expandable.Shape, k_ExpandedState,
                    (serialized, owner) => GetAdvanced(Advanceable.Shape, serialized, owner),
                    (serialized, owner) => SwitchAdvanced(Advanceable.Shape, serialized, owner),
                    DrawShapeContent,
                    DrawShapeAdvancedContent
                    ),
                CED.AdvancedFoldoutGroup(s_Styles.emissionHeader, Expandable.Emission, k_ExpandedState,
                    (serialized, owner) => GetAdvanced(Advanceable.Emission, serialized, owner),
                    (serialized, owner) => SwitchAdvanced(Advanceable.Emission, serialized, owner),
                    DrawEmissionContent,
                    DrawEmissionAdvancedContent
                    ),
                CED.FoldoutGroup(s_Styles.volumetricHeader, Expandable.Volumetric, k_ExpandedState, DrawVolumetric),
#if ENABLE_RAYTRACING
                CED.Conditional((serialized, owner) => serialized.editorLightShape != LightShape.Tube,
#else
                CED.Conditional((serialized, owner) => serialized.editorLightShape != LightShape.Rectangle && serialized.editorLightShape != LightShape.Tube,
#endif
                    CED.AdvancedFoldoutGroup(s_Styles.shadowHeader, Expandable.Shadows, k_ExpandedState,
                        (serialized, owner) => GetAdvanced(Advanceable.Shadow, serialized, owner),
                        (serialized, owner) => SwitchAdvanced(Advanceable.Shadow, serialized, owner),
                        CED.Group(
                            CED.FoldoutGroup(s_Styles.shadowMapSubHeader, Expandable.ShadowMap, k_ExpandedState, FoldoutOption.SubFoldout | FoldoutOption.Indent | FoldoutOption.NoSpaceAtEnd, DrawShadowMapContent),
                            CED.Conditional((serialized, owner) => GetAdvanced(Advanceable.Shadow, serialized, owner) && k_ExpandedState[Expandable.ShadowMap],
                                CED.Group(GroupOption.Indent, DrawShadowMapAdvancedContent)),
                            CED.space,
                            // Very High setting
                            CED.Conditional((serialized, owner) => HasShadowQualitySettingsUI(HDShadowQuality.VeryHigh, serialized, owner),
                                CED.FoldoutGroup(s_Styles.veryHighShadowQualitySubHeader, Expandable.ShadowQuality, k_ExpandedState, FoldoutOption.SubFoldout | FoldoutOption.Indent, DrawVeryHighShadowSettingsContent)),
                            // High setting
                            CED.Conditional((serialized, owner) => HasShadowQualitySettingsUI(HDShadowQuality.High, serialized, owner),
                                CED.FoldoutGroup(s_Styles.highShadowQualitySubHeader, Expandable.ShadowQuality, k_ExpandedState, FoldoutOption.SubFoldout | FoldoutOption.Indent, DrawHighShadowSettingsContent)),
                            CED.Conditional((serialized, owner) => HasShadowQualitySettingsUI(HDShadowQuality.Medium, serialized, owner),
                                CED.FoldoutGroup(s_Styles.mediumShadowQualitySubHeader, Expandable.ShadowQuality, k_ExpandedState, FoldoutOption.SubFoldout | FoldoutOption.Indent, DrawMediumShadowSettingsContent)),
                            CED.Conditional((serialized, owner) => HasShadowQualitySettingsUI(HDShadowQuality.Low, serialized, owner),
                                CED.FoldoutGroup(s_Styles.lowShadowQualitySubHeader, Expandable.ShadowQuality, k_ExpandedState, FoldoutOption.SubFoldout | FoldoutOption.Indent, DrawLowShadowSettingsContent)),

#if ENABLE_RAYTRACING
                            CED.Conditional((serialized, owner) => serialized.editorLightShape != LightShape.Rectangle && serialized.editorLightShape != LightShape.Tube,
#endif
                            CED.FoldoutGroup(s_Styles.contactShadowsSubHeader, Expandable.ContactShadow, k_ExpandedState, FoldoutOption.SubFoldout | FoldoutOption.Indent | FoldoutOption.NoSpaceAtEnd, DrawContactShadowsContent)

#if ENABLE_RAYTRACING
                            ),
#else
                            ,
#endif
                            CED.Conditional((serialized, owner) => serialized.settings.isBakedOrMixed || serialized.settings.isCompletelyBaked,
                                CED.space,
                                CED.FoldoutGroup(s_Styles.bakedShadowsSubHeader, Expandable.BakedShadow, k_ExpandedState, FoldoutOption.SubFoldout | FoldoutOption.Indent | FoldoutOption.NoSpaceAtEnd, DrawBakedShadowsContent))
                            ),
                        CED.noop //will only add parameter in first sub header
                        )
                    )
            );

            //quicker than standard reflection as it is compiled
            var paramLabel = Expression.Parameter(typeof(GUIContent), "label");
            var paramProperty = Expression.Parameter(typeof(SerializedProperty), "property");
            var paramSettings = Expression.Parameter(typeof(LightEditor.Settings), "settings");
            System.Reflection.MethodInfo sliderWithTextureInfo = typeof(EditorGUILayout)
                .GetMethod(
                    "SliderWithTexture",
                    System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static,
                    null,
                    System.Reflection.CallingConventions.Any,
                    new[] { typeof(GUIContent), typeof(SerializedProperty), typeof(float), typeof(float), typeof(float), typeof(Texture2D), typeof(GUILayoutOption[]) },
                    null);
            var sliderWithTextureCall = Expression.Call(
                sliderWithTextureInfo,
                paramLabel,
                paramProperty,
                Expression.Constant((float)typeof(LightEditor.Settings).GetField("kMinKelvin", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetRawConstantValue()),
                Expression.Constant((float)typeof(LightEditor.Settings).GetField("kMaxKelvin", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetRawConstantValue()),
                Expression.Constant((float)typeof(LightEditor.Settings).GetField("kSliderPower", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetRawConstantValue()),
                Expression.Field(paramSettings, typeof(LightEditor.Settings).GetField("m_KelvinGradientTexture", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)),
                Expression.Constant(null, typeof(GUILayoutOption[])));
            var lambda = Expression.Lambda<Action<GUIContent, SerializedProperty, LightEditor.Settings>>(sliderWithTextureCall, paramLabel, paramProperty, paramSettings);
            SliderWithTexture = lambda.Compile();
        }