void OnEnable() { m_Analytics = Analytics.Renderer2DAnalytics.instance; m_ModifiedLights = new HashSet <Light2D>(); m_SortingLayerDropDown = new SortingLayerDropDown(); m_LightType = serializedObject.FindProperty("m_LightType"); m_LightColor = serializedObject.FindProperty("m_Color"); m_LightIntensity = serializedObject.FindProperty("m_Intensity"); m_UseNormalMap = serializedObject.FindProperty("m_UseNormalMap"); m_ShadowIntensity = serializedObject.FindProperty("m_ShadowIntensity"); m_ShadowVolumeIntensity = serializedObject.FindProperty("m_ShadowVolumeIntensity"); m_ApplyToSortingLayers = serializedObject.FindProperty("m_ApplyToSortingLayers"); m_VolumetricAlpha = serializedObject.FindProperty("m_LightVolumeOpacity"); m_BlendStyleIndex = serializedObject.FindProperty("m_BlendStyleIndex"); m_FalloffIntensity = serializedObject.FindProperty("m_FalloffIntensity"); m_PointZDistance = serializedObject.FindProperty("m_PointLightDistance"); m_LightOrder = serializedObject.FindProperty("m_LightOrder"); m_AlphaBlendOnOverlap = serializedObject.FindProperty("m_AlphaBlendOnOverlap"); // Point Light m_PointInnerAngle = serializedObject.FindProperty("m_PointLightInnerAngle"); m_PointOuterAngle = serializedObject.FindProperty("m_PointLightOuterAngle"); m_PointInnerRadius = serializedObject.FindProperty("m_PointLightInnerRadius"); m_PointOuterRadius = serializedObject.FindProperty("m_PointLightOuterRadius"); m_PointLightCookie = serializedObject.FindProperty("m_LightCookieSprite"); m_PointLightQuality = serializedObject.FindProperty("m_PointLightQuality"); // Shape Light m_ShapeLightParametricRadius = serializedObject.FindProperty("m_ShapeLightParametricRadius"); m_ShapeLightFalloffSize = serializedObject.FindProperty("m_ShapeLightFalloffSize"); m_ShapeLightParametricSides = serializedObject.FindProperty("m_ShapeLightParametricSides"); m_ShapeLightParametricAngleOffset = serializedObject.FindProperty("m_ShapeLightParametricAngleOffset"); m_ShapeLightFalloffOffset = serializedObject.FindProperty("m_ShapeLightFalloffOffset"); m_ShapeLightSprite = serializedObject.FindProperty("m_LightCookieSprite"); m_AnyBlendStyleEnabled = false; var blendStyleIndices = new List <int>(); var blendStyleNames = new List <string>(); var rendererData = Light2DEditorUtility.GetRenderer2DData(); if (rendererData != null) { for (int i = 0; i < rendererData.lightBlendStyles.Length; ++i) { blendStyleIndices.Add(i); ref var blendStyle = ref rendererData.lightBlendStyles[i]; if (blendStyle.enabled) { blendStyleNames.Add(blendStyle.name); m_AnyBlendStyleEnabled = true; } else { blendStyleNames.Add(blendStyle.name + " (Disabled)"); } } }
void OnEnable() { m_Analytics = Analytics.Renderer2DAnalytics.instance; m_ModifiedLights = new HashSet <Light2D>(); m_SortingLayerDropDown = new SortingLayerDropDown(); m_BlendingSettingsFoldout = new SavedBool($"{target.GetType()}.2DURPBlendingSettingsFoldout", false); m_ShadowsSettingsFoldout = new SavedBool($"{target.GetType()}.2DURPShadowsSettingsFoldout", false); m_VolumetricSettingsFoldout = new SavedBool($"{target.GetType()}.2DURPVolumetricSettingsFoldout", false); m_NormalMapsSettingsFoldout = new SavedBool($"{target.GetType()}.2DURPNormalMapsSettingsFoldout", false); m_LightType = serializedObject.FindProperty("m_LightType"); m_LightColor = serializedObject.FindProperty("m_Color"); m_LightIntensity = serializedObject.FindProperty("m_Intensity"); m_UseNormalMap = serializedObject.FindProperty("m_UseNormalMap"); m_ShadowIntensity = serializedObject.FindProperty("m_ShadowIntensity"); m_ShadowIntensityEnabled = serializedObject.FindProperty("m_ShadowIntensityEnabled"); m_ShadowVolumeIntensity = serializedObject.FindProperty("m_ShadowVolumeIntensity"); m_ShadowVolumeIntensityEnabled = serializedObject.FindProperty("m_ShadowVolumeIntensityEnabled"); m_ApplyToSortingLayers = serializedObject.FindProperty("m_ApplyToSortingLayers"); m_VolumetricIntensity = serializedObject.FindProperty("m_LightVolumeIntensity"); m_VolumetricIntensityEnabled = serializedObject.FindProperty("m_LightVolumeIntensityEnabled"); m_BlendStyleIndex = serializedObject.FindProperty("m_BlendStyleIndex"); m_FalloffIntensity = serializedObject.FindProperty("m_FalloffIntensity"); m_NormalMapZDistance = serializedObject.FindProperty("m_NormalMapDistance"); m_NormalMapQuality = serializedObject.FindProperty("m_NormalMapQuality"); m_LightOrder = serializedObject.FindProperty("m_LightOrder"); m_OverlapOperation = serializedObject.FindProperty("m_OverlapOperation"); // Point Light m_PointInnerAngle = serializedObject.FindProperty("m_PointLightInnerAngle"); m_PointOuterAngle = serializedObject.FindProperty("m_PointLightOuterAngle"); m_PointInnerRadius = serializedObject.FindProperty("m_PointLightInnerRadius"); m_PointOuterRadius = serializedObject.FindProperty("m_PointLightOuterRadius"); m_DeprecatedPointLightSprite = serializedObject.FindProperty("m_DeprecatedPointLightCookieSprite"); // Shape Light m_ShapeLightParametricRadius = serializedObject.FindProperty("m_ShapeLightParametricRadius"); m_ShapeLightFalloffSize = serializedObject.FindProperty("m_ShapeLightFalloffSize"); m_ShapeLightParametricSides = serializedObject.FindProperty("m_ShapeLightParametricSides"); m_ShapeLightSprite = serializedObject.FindProperty("m_LightCookieSprite"); m_AnyBlendStyleEnabled = false; var blendStyleIndices = new List <int>(); var blendStyleNames = new List <string>(); var rendererData = Light2DEditorUtility.GetRenderer2DData(); if (rendererData != null) { for (int i = 0; i < rendererData.lightBlendStyles.Length; ++i) { blendStyleIndices.Add(i); ref var blendStyle = ref rendererData.lightBlendStyles[i]; blendStyleNames.Add(blendStyle.name); m_AnyBlendStyleEnabled = true; } }