Пример #1
0
 private static extern void Internal_CreateDefault(out PostProcessSettings value);
Пример #2
0
 private static extern void Internal_SetPostProcessSettings(IntPtr instance, ref PostProcessSettings value);
        /// <summary>
        /// Constructs a new set of GUI elements for inspecting the post process settings object.
        /// </summary>
        /// <param name="settings">Initial values to assign to the GUI elements.</param>
        /// <param name="layout">Layout to append the GUI elements to.</param>
        /// <param name="properties">A set of properties that are persisted by the parent inspector. Used for saving state.
        ///                          </param>
        public PostProcessSettingsGUI(PostProcessSettings settings, GUILayout layout, SerializableProperties properties)
        {
            this.settings = settings;
            this.properties = properties;

            // Auto exposure
            enableAutoExposureField.OnChanged += x => { this.settings.EnableAutoExposure = x; MarkAsModified(); ConfirmModify(); };
            layout.AddElement(enableAutoExposureField);

            autoExposureFoldout.OnToggled += x =>
            {
                properties.SetBool("autoExposure_Expanded", x);
                ToggleFoldoutFields();
            };
            layout.AddElement(autoExposureFoldout);

            autoExposureLayout = layout.AddLayoutX();
            {
                autoExposureLayout.AddSpace(10);

                GUILayoutY contentsLayout = autoExposureLayout.AddLayoutY();
                autoExposureGUI = new AutoExposureSettingsGUI(settings.AutoExposure, contentsLayout);
                autoExposureGUI.OnChanged += x => { this.settings.AutoExposure = x; MarkAsModified(); };
                autoExposureGUI.OnConfirmed += ConfirmModify;
            }

            // Tonemapping
            enableToneMappingField.OnChanged += x => { this.settings.EnableTonemapping = x; MarkAsModified(); ConfirmModify(); };
            layout.AddElement(enableToneMappingField);

            //// Tonemapping settings
            toneMappingFoldout.OnToggled += x =>
            {
                properties.SetBool("toneMapping_Expanded", x);
                ToggleFoldoutFields();
            };
            layout.AddElement(toneMappingFoldout);

            toneMappingLayout = layout.AddLayoutX();
            {
                toneMappingLayout.AddSpace(10);

                GUILayoutY contentsLayout = toneMappingLayout.AddLayoutY();
                toneMappingGUI = new TonemappingSettingsGUI(settings.Tonemapping, contentsLayout);
                toneMappingGUI.OnChanged += x => { this.settings.Tonemapping = x; MarkAsModified(); };
                toneMappingGUI.OnConfirmed += ConfirmModify;
            }

            //// White balance settings
            whiteBalanceFoldout.OnToggled += x =>
            {
                properties.SetBool("whiteBalance_Expanded", x);
                ToggleFoldoutFields();
            };
            layout.AddElement(whiteBalanceFoldout);

            whiteBalanceLayout = layout.AddLayoutX();
            {
                whiteBalanceLayout.AddSpace(10);

                GUILayoutY contentsLayout = whiteBalanceLayout.AddLayoutY();
                whiteBalanceGUI = new WhiteBalanceSettingsGUI(settings.WhiteBalance, contentsLayout);
                whiteBalanceGUI.OnChanged += x => { this.settings.WhiteBalance = x; MarkAsModified(); };
                whiteBalanceGUI.OnConfirmed += ConfirmModify;
            }

            //// Color grading settings
            colorGradingFoldout.OnToggled += x =>
            {
                properties.SetBool("colorGrading_Expanded", x);
                ToggleFoldoutFields();
            };
            layout.AddElement(colorGradingFoldout);

            colorGradingLayout = layout.AddLayoutX();
            {
                colorGradingLayout.AddSpace(10);

                GUILayoutY contentsLayout = colorGradingLayout.AddLayoutY();
                colorGradingGUI = new ColorGradingSettingsGUI(settings.ColorGrading, contentsLayout);
                colorGradingGUI.OnChanged += x => { this.settings.ColorGrading = x; MarkAsModified(); };
                colorGradingGUI.OnConfirmed += ConfirmModify;
            }

            // Gamma
            gammaField.OnChanged += x => { this.settings.Gamma = x; MarkAsModified(); ConfirmModify(); };
            layout.AddElement(gammaField);

            // Exposure scale
            exposureScaleField.OnChanged += x => { this.settings.ExposureScale = x; MarkAsModified(); ConfirmModify(); };
            layout.AddElement(exposureScaleField);

            ToggleFoldoutFields();
        }
Пример #4
0
 internal SerializableData()
 {
     postProcessSettings = PostProcessSettings.CreateDefault();
 }
 private static extern void Internal_CreateDefault(out PostProcessSettings value);
Пример #6
0
 private static extern void Internal_SetPostProcessSettings(IntPtr instance, ref PostProcessSettings value);
Пример #7
0
 internal SerializableData()
 {
     postProcessSettings = PostProcessSettings.CreateDefault();
 }