Beispiel #1
0
        public new void OnEnable()
        {
            m_UniversalRenderPipeline = GraphicsSettings.renderPipelineAsset as UniversalRenderPipelineAsset;

            m_CommonCameraSettingsFoldout = new SavedBool($"{target.GetType()}.CommonCameraSettingsFoldout", false);
            m_EnvironmentSettingsFoldout  = new SavedBool($"{target.GetType()}.EnvironmentSettingsFoldout", false);
            m_OutputSettingsFoldout       = new SavedBool($"{target.GetType()}.OutputSettingsFoldout", false);
            m_RenderingSettingsFoldout    = new SavedBool($"{target.GetType()}.RenderingSettingsFoldout", false);
            m_StackSettingsFoldout        = new SavedBool($"{target.GetType()}.StackSettingsFoldout", false);
            m_AdditionalCameraData        = camera.gameObject.GetComponent <UniversalAdditionalCameraData>();
            m_ErrorIcon = EditorGUIUtility.Load("icons/console.erroricon.sml.png") as Texture2D;
            validCameras.Clear();
            errorCameras.Clear();
            settings.OnEnable();

            // Additional Camera Data
            if (m_AdditionalCameraData == null)
            {
                m_AdditionalCameraData = camera.gameObject.AddComponent <UniversalAdditionalCameraData>();
            }
            init(m_AdditionalCameraData);

            UpdateAnimationValues(true);
            UpdateCameraTypeIntPopupData();

            UpdateCameras();
        }
        public new void OnEnable()
        {
            base.OnEnable();

            m_CommonCameraSettingsFoldout = new SavedBool($"{target.GetType()}.CommonCameraSettingsFoldout", false);
            m_EnvironmentSettingsFoldout  = new SavedBool($"{target.GetType()}.EnvironmentSettingsFoldout", false);
            m_OutputSettingsFoldout       = new SavedBool($"{target.GetType()}.OutputSettingsFoldout", false);
            m_RenderingSettingsFoldout    = new SavedBool($"{target.GetType()}.RenderingSettingsFoldout", false);
            m_StackSettingsFoldout        = new SavedBool($"{target.GetType()}.StackSettingsFoldout", false);

            var additionalCameraList = new List <Object>();

            foreach (var cameraTarget in targets)
            {
                var additionData = (cameraTarget as Component).gameObject.GetComponent <UniversalAdditionalCameraData>();
                if (additionData == null)
                {
                    additionData = (cameraTarget as Component).gameObject.AddComponent <UniversalAdditionalCameraData>();
                }
                m_AdditionalCameraDatas[cameraTarget] = additionData;
                additionalCameraList.Add(additionData);
            }
            m_ErrorIcon = EditorGUIUtility.Load("icons/console.erroricon.sml.png") as Texture2D;
            validCameras.Clear();
            errorCameras.Clear();
            settings.OnEnable();

            init(additionalCameraList);

            UpdateAnimationValues(true);
            UpdateCameraTypeIntPopupData();

            UpdateCameras();
        }
        public new void OnEnable()
        {
            base.OnEnable();

            m_CommonCameraSettingsFoldout = new SavedBool($"{target.GetType()}.CommonCameraSettingsFoldout", false);
            m_EnvironmentSettingsFoldout  = new SavedBool($"{target.GetType()}.EnvironmentSettingsFoldout", false);
            m_OutputSettingsFoldout       = new SavedBool($"{target.GetType()}.OutputSettingsFoldout", false);
            m_RenderingSettingsFoldout    = new SavedBool($"{target.GetType()}.RenderingSettingsFoldout", false);
            m_StackSettingsFoldout        = new SavedBool($"{target.GetType()}.StackSettingsFoldout", false);

            var additionalCameraList = new List <Object>();

            foreach (var cameraTarget in targets)
            {
                var additionData = (cameraTarget as Component).gameObject.GetComponent <UniversalAdditionalCameraData>();
                if (additionData == null)
                {
                    additionData = (cameraTarget as Component).gameObject.AddComponent <UniversalAdditionalCameraData>();
                }
                m_AdditionalCameraDatas[cameraTarget] = additionData;
                additionalCameraList.Add(additionData);
            }
            m_ErrorIcon   = LoadConsoleIcon(true);
            m_WarningIcon = LoadConsoleIcon(false);
            validCameras.Clear();
            m_TypeErrorCameras.Clear();
            m_OutputWarningCameras.Clear();
            settings.OnEnable();

            init(additionalCameraList);

            UpdateAnimationValues(true);

            UpdateCameras();
        }
Beispiel #4
0
        void OnEnable()
        {
            m_GeneralSettingsFoldout        = new SavedBool($"{target.GetType()}.GeneralSettingsFoldout", false);
            m_QualitySettingsFoldout        = new SavedBool($"{target.GetType()}.QualitySettingsFoldout", false);
            m_LightingSettingsFoldout       = new SavedBool($"{target.GetType()}.LightingSettingsFoldout", false);
            m_ShadowSettingsFoldout         = new SavedBool($"{target.GetType()}.ShadowSettingsFoldout", false);
            m_PostProcessingSettingsFoldout = new SavedBool($"{target.GetType()}.PostProcessingSettingsFoldout", false);
            m_AdvancedSettingsFoldout       = new SavedBool($"{target.GetType()}.AdvancedSettingsFoldout", false);
            m_AdaptivePerformanceFoldout    = new SavedBool($"{target.GetType()}.AdaptivePerformanceFoldout", false);

            m_RendererDataProp    = serializedObject.FindProperty("m_RendererDataList");
            m_DefaultRendererProp = serializedObject.FindProperty("m_DefaultRendererIndex");
            m_RendererDataList    = new ReorderableList(serializedObject, m_RendererDataProp, false, true, true, true);

            DrawRendererListLayout(m_RendererDataList, m_RendererDataProp);

            m_RequireDepthTextureProp  = serializedObject.FindProperty("m_RequireDepthTexture");
            m_RequireOpaqueTextureProp = serializedObject.FindProperty("m_RequireOpaqueTexture");
            m_OpaqueDownsamplingProp   = serializedObject.FindProperty("m_OpaqueDownsampling");
            m_SupportsTerrainHolesProp = serializedObject.FindProperty("m_SupportsTerrainHoles");

            m_HDR         = serializedObject.FindProperty("m_SupportsHDR");
            m_MSAA        = serializedObject.FindProperty("m_MSAA");
            m_RenderScale = serializedObject.FindProperty("m_RenderScale");

            m_MainLightRenderingModeProp       = serializedObject.FindProperty("m_MainLightRenderingMode");
            m_MainLightShadowsSupportedProp    = serializedObject.FindProperty("m_MainLightShadowsSupported");
            m_MainLightShadowmapResolutionProp = serializedObject.FindProperty("m_MainLightShadowmapResolution");

            m_AdditionalLightsRenderingModeProp      = serializedObject.FindProperty("m_AdditionalLightsRenderingMode");
            m_AdditionalLightsPerObjectLimitProp     = serializedObject.FindProperty("m_AdditionalLightsPerObjectLimit");
            m_AdditionalLightShadowsSupportedProp    = serializedObject.FindProperty("m_AdditionalLightShadowsSupported");
            m_AdditionalLightShadowmapResolutionProp = serializedObject.FindProperty("m_AdditionalLightsShadowmapResolution");

            m_ShadowDistanceProp = serializedObject.FindProperty("m_ShadowDistance");
            // Marked by Bioum
            m_ShadowFadeProp = serializedObject.FindProperty("m_ShadowFade");
            // Marked by Bioum
            m_ShadowCascadesProp       = serializedObject.FindProperty("m_ShadowCascades");
            m_ShadowCascade2SplitProp  = serializedObject.FindProperty("m_Cascade2Split");
            m_ShadowCascade4SplitProp  = serializedObject.FindProperty("m_Cascade4Split");
            m_ShadowDepthBiasProp      = serializedObject.FindProperty("m_ShadowDepthBias");
            m_ShadowNormalBiasProp     = serializedObject.FindProperty("m_ShadowNormalBias");
            m_SoftShadowsSupportedProp = serializedObject.FindProperty("m_SoftShadowsSupported");

            m_SRPBatcher = serializedObject.FindProperty("m_UseSRPBatcher");
            m_SupportsDynamicBatching    = serializedObject.FindProperty("m_SupportsDynamicBatching");
            m_MixedLightingSupportedProp = serializedObject.FindProperty("m_MixedLightingSupported");
            m_DebugLevelProp             = serializedObject.FindProperty("m_DebugLevel");

            m_ShaderVariantLogLevel = serializedObject.FindProperty("m_ShaderVariantLogLevel");

            m_PostProcessingFeatureSet = serializedObject.FindProperty("m_PostProcessingFeatureSet");
            m_ColorGradingMode         = serializedObject.FindProperty("m_ColorGradingMode");
            m_ColorGradingLutSize      = serializedObject.FindProperty("m_ColorGradingLutSize");

            m_UseAdaptivePerformance = serializedObject.FindProperty("m_UseAdaptivePerformance");

            selectedLightRenderingMode = (LightRenderingMode)m_AdditionalLightsRenderingModeProp.intValue;
        }
 private void CreateFoldoutBools()
 {
     m_Foldouts = new SavedBool[m_RenderPasses.arraySize];
     for (var i = 0; i < m_RenderPasses.arraySize; i++)
     {
         var name = m_RenderPasses.serializedObject.targetObject.name;
         m_Foldouts[i] =
             new SavedBool($"{name}.ELEMENT{i.ToString()}.PassFoldout", false);
     }
 }
        void OnEnable()
        {
            m_GeneralSettingsFoldout        = new SavedBool($"{target.GetType()}.GeneralSettingsFoldout", false);
            m_QualitySettingsFoldout        = new SavedBool($"{target.GetType()}.QualitySettingsFoldout", false);
            m_LightingSettingsFoldout       = new SavedBool($"{target.GetType()}.LightingSettingsFoldout", false);
            m_ShadowSettingsFoldout         = new SavedBool($"{target.GetType()}.ShadowSettingsFoldout", false);
            m_PostProcessingSettingsFoldout = new SavedBool($"{target.GetType()}.PostProcessingSettingsFoldout", false);
            m_AdvancedSettingsFoldout       = new SavedBool($"{target.GetType()}.AdvancedSettingsFoldout", false);

            m_RendererTypeProp = serializedObject.FindProperty("m_RendererType");
            m_RendererDataProp = serializedObject.FindProperty("m_RendererData");

            m_RequireDepthTextureProp  = serializedObject.FindProperty("m_RequireDepthTexture");
            m_RequireOpaqueTextureProp = serializedObject.FindProperty("m_RequireOpaqueTexture");
            m_OpaqueDownsamplingProp   = serializedObject.FindProperty("m_OpaqueDownsampling");

            m_HDR         = serializedObject.FindProperty("m_SupportsHDR");
            m_MSAA        = serializedObject.FindProperty("m_MSAA");
            m_RenderScale = serializedObject.FindProperty("m_RenderScale");

            m_MainLightRenderingModeProp       = serializedObject.FindProperty("m_MainLightRenderingMode");
            m_MainLightShadowsSupportedProp    = serializedObject.FindProperty("m_MainLightShadowsSupported");
            m_MainLightShadowmapResolutionProp = serializedObject.FindProperty("m_MainLightShadowmapResolution");

            m_AdditionalLightsRenderingModeProp      = serializedObject.FindProperty("m_AdditionalLightsRenderingMode");
            m_AdditionalLightsPerObjectLimitProp     = serializedObject.FindProperty("m_AdditionalLightsPerObjectLimit");
            m_AdditionalLightShadowsSupportedProp    = serializedObject.FindProperty("m_AdditionalLightShadowsSupported");
            m_AdditionalLightShadowmapResolutionProp = serializedObject.FindProperty("m_AdditionalLightsShadowmapResolution");

            m_ShadowDistanceProp       = serializedObject.FindProperty("m_ShadowDistance");
            m_ShadowCascadesProp       = serializedObject.FindProperty("m_ShadowCascades");
            m_ShadowCascade2SplitProp  = serializedObject.FindProperty("m_Cascade2Split");
            m_ShadowCascade4SplitProp  = serializedObject.FindProperty("m_Cascade4Split");
            m_ShadowDepthBiasProp      = serializedObject.FindProperty("m_ShadowDepthBias");
            m_ShadowNormalBiasProp     = serializedObject.FindProperty("m_ShadowNormalBias");
            m_SoftShadowsSupportedProp = serializedObject.FindProperty("m_SoftShadowsSupported");

            m_SRPBatcher = serializedObject.FindProperty("m_UseSRPBatcher");
            m_SupportsDynamicBatching    = serializedObject.FindProperty("m_SupportsDynamicBatching");
            m_MixedLightingSupportedProp = serializedObject.FindProperty("m_MixedLightingSupported");

            m_ShaderVariantLogLevel = serializedObject.FindProperty("m_ShaderVariantLogLevel");

            m_ColorGradingMode    = serializedObject.FindProperty("m_ColorGradingMode");
            m_ColorGradingLutSize = serializedObject.FindProperty("m_ColorGradingLutSize");

            selectedLightRenderingMode = (LightRenderingMode)m_AdditionalLightsRenderingModeProp.intValue;
        }
        public new void OnEnable()
        {
            base.OnEnable();
            settings.OnEnable();

            m_SerializedCamera = new UniversalRenderPipelineSerializedCamera(serializedObject);

            m_CommonCameraSettingsFoldout = new SavedBool($"{target.GetType()}.CommonCameraSettingsFoldout", false);
            m_EnvironmentSettingsFoldout  = new SavedBool($"{target.GetType()}.EnvironmentSettingsFoldout", false);
            m_OutputSettingsFoldout       = new SavedBool($"{target.GetType()}.OutputSettingsFoldout", false);
            m_RenderingSettingsFoldout    = new SavedBool($"{target.GetType()}.RenderingSettingsFoldout", false);
            m_StackSettingsFoldout        = new SavedBool($"{target.GetType()}.StackSettingsFoldout", false);

            m_ErrorIcon   = LoadConsoleIcon(true);
            m_WarningIcon = LoadConsoleIcon(false);
            validCameras.Clear();
            m_TypeErrorCameras.Clear();
            m_OutputWarningCameras.Clear();

            UpdateAnimationValues(true);

            UpdateCameras();
        }
Beispiel #8
0
        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];

                    if (blendStyle.maskTextureChannel == Light2DBlendStyle.TextureChannel.None)
                    {
                        blendStyleNames.Add(blendStyle.name);
                    }
                    else
                    {
                        var name = string.Format("{0} ({1})", blendStyle.name, blendStyle.maskTextureChannel);
                        blendStyleNames.Add(name);
                    }

                    m_AnyBlendStyleEnabled = true;
                }
            }
        void OnEnable()
        {
            m_GeneralSettingsFoldout        = new SavedBool($"{target.GetType()}.GeneralSettingsFoldout", false);
            m_QualitySettingsFoldout        = new SavedBool($"{target.GetType()}.QualitySettingsFoldout", false);
            m_LightingSettingsFoldout       = new SavedBool($"{target.GetType()}.LightingSettingsFoldout", false);
            m_ShadowSettingsFoldout         = new SavedBool($"{target.GetType()}.ShadowSettingsFoldout", false);
            m_PostProcessingSettingsFoldout = new SavedBool($"{target.GetType()}.PostProcessingSettingsFoldout", false);
            m_AdvancedSettingsFoldout       = new SavedBool($"{target.GetType()}.AdvancedSettingsFoldout", false);
            m_AdaptivePerformanceFoldout    = new SavedBool($"{target.GetType()}.AdaptivePerformanceFoldout", false);

            m_RendererDataProp    = serializedObject.FindProperty("m_RendererDataList");
            m_DefaultRendererProp = serializedObject.FindProperty("m_DefaultRendererIndex");
            m_RendererDataList    = new ReorderableList(serializedObject, m_RendererDataProp, true, true, true, true);

            DrawRendererListLayout(m_RendererDataList, m_RendererDataProp);

            m_RequireDepthTextureProp  = serializedObject.FindProperty("m_RequireDepthTexture");
            m_RequireOpaqueTextureProp = serializedObject.FindProperty("m_RequireOpaqueTexture");
            m_OpaqueDownsamplingProp   = serializedObject.FindProperty("m_OpaqueDownsampling");
            m_SupportsTerrainHolesProp = serializedObject.FindProperty("m_SupportsTerrainHoles");

            m_HDR         = serializedObject.FindProperty("m_SupportsHDR");
            m_MSAA        = serializedObject.FindProperty("m_MSAA");
            m_RenderScale = serializedObject.FindProperty("m_RenderScale");

            m_MainLightRenderingModeProp       = serializedObject.FindProperty("m_MainLightRenderingMode");
            m_MainLightShadowsSupportedProp    = serializedObject.FindProperty("m_MainLightShadowsSupported");
            m_MainLightShadowmapResolutionProp = serializedObject.FindProperty("m_MainLightShadowmapResolution");

            m_AdditionalLightsRenderingModeProp      = serializedObject.FindProperty("m_AdditionalLightsRenderingMode");
            m_AdditionalLightsPerObjectLimitProp     = serializedObject.FindProperty("m_AdditionalLightsPerObjectLimit");
            m_AdditionalLightShadowsSupportedProp    = serializedObject.FindProperty("m_AdditionalLightShadowsSupported");
            m_AdditionalLightShadowmapResolutionProp = serializedObject.FindProperty("m_AdditionalLightsShadowmapResolution");

            m_AdditionalLightsShadowResolutionTierLowProp    = serializedObject.FindProperty("m_AdditionalLightsShadowResolutionTierLow");
            m_AdditionalLightsShadowResolutionTierMediumProp = serializedObject.FindProperty("m_AdditionalLightsShadowResolutionTierMedium");
            m_AdditionalLightsShadowResolutionTierHighProp   = serializedObject.FindProperty("m_AdditionalLightsShadowResolutionTierHigh");

            m_ShadowDistanceProp = serializedObject.FindProperty("m_ShadowDistance");

            m_ShadowCascadeCountProp   = serializedObject.FindProperty("m_ShadowCascadeCount");
            m_ShadowCascade2SplitProp  = serializedObject.FindProperty("m_Cascade2Split");
            m_ShadowCascade3SplitProp  = serializedObject.FindProperty("m_Cascade3Split");
            m_ShadowCascade4SplitProp  = serializedObject.FindProperty("m_Cascade4Split");
            m_ShadowCascadeBorderProp  = serializedObject.FindProperty("m_CascadeBorder");
            m_ShadowDepthBiasProp      = serializedObject.FindProperty("m_ShadowDepthBias");
            m_ShadowNormalBiasProp     = serializedObject.FindProperty("m_ShadowNormalBias");
            m_SoftShadowsSupportedProp = serializedObject.FindProperty("m_SoftShadowsSupported");

            m_SRPBatcher = serializedObject.FindProperty("m_UseSRPBatcher");
            m_SupportsDynamicBatching    = serializedObject.FindProperty("m_SupportsDynamicBatching");
            m_MixedLightingSupportedProp = serializedObject.FindProperty("m_MixedLightingSupported");
            m_DebugLevelProp             = serializedObject.FindProperty("m_DebugLevel");

            m_ShaderVariantLogLevel = serializedObject.FindProperty("m_ShaderVariantLogLevel");

            m_ColorGradingMode    = serializedObject.FindProperty("m_ColorGradingMode");
            m_ColorGradingLutSize = serializedObject.FindProperty("m_ColorGradingLutSize");

            m_UseFastSRGBLinearConversion = serializedObject.FindProperty("m_UseFastSRGBLinearConversion");

            m_UseAdaptivePerformance = serializedObject.FindProperty("m_UseAdaptivePerformance");

            string Key = "Universal_Shadow_Setting_Unit:UI_State";

            m_State = new EditorPrefBoolFlags <EditorUtils.Unit>(Key);
        }