Пример #1
0
 private static extern void Internal_TonemappingSettings(TonemappingSettings managedInstance);
 private static extern void Internal_settonemapping(IntPtr thisPtr, TonemappingSettings value);
        /// <summary>
        /// Constructs a new set of GUI elements for inspecting the tone mapping 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>
        public TonemappingSettingsGUI(TonemappingSettings settings, GUILayout layout)
        {
            this.settings = settings;

            shoulderStrengthField.OnChanged += x => { this.settings.FilmicCurveShoulderStrength = x; MarkAsModified(); };
            shoulderStrengthField.OnFocusLost += ConfirmModify;
            shoulderStrengthField.OnConfirmed += ConfirmModify;

            linearStrengthField.OnChanged += x => { this.settings.FilmicCurveLinearStrength = x; MarkAsModified(); };
            linearStrengthField.OnFocusLost += ConfirmModify;
            linearStrengthField.OnConfirmed += ConfirmModify;

            linearAngleField.OnChanged += x => { this.settings.FilmicCurveLinearAngle = x; MarkAsModified(); };
            linearAngleField.OnFocusLost += ConfirmModify;
            linearAngleField.OnConfirmed += ConfirmModify;

            toeStrengthField.OnChanged += x => { this.settings.FilmicCurveToeStrength = x; MarkAsModified(); };
            toeStrengthField.OnFocusLost += ConfirmModify;
            toeStrengthField.OnConfirmed += ConfirmModify;

            toeNumeratorField.OnChanged += x => { this.settings.FilmicCurveToeNumerator = x; MarkAsModified(); };
            toeNumeratorField.OnFocusLost += ConfirmModify;
            toeNumeratorField.OnConfirmed += ConfirmModify;

            toeDenominatorField.OnChanged += x => { this.settings.FilmicCurveToeDenominator = x; MarkAsModified(); };
            toeDenominatorField.OnFocusLost += ConfirmModify;
            toeDenominatorField.OnConfirmed += ConfirmModify;

            whitePointField.OnChanged += x => { this.settings.FilmicCurveLinearWhitePoint = x; MarkAsModified(); };
            whitePointField.OnFocusLost += ConfirmModify;
            whitePointField.OnConfirmed += ConfirmModify;

            layout.AddElement(shoulderStrengthField);
            layout.AddElement(linearStrengthField);
            layout.AddElement(linearAngleField);
            layout.AddElement(toeStrengthField);
            layout.AddElement(toeNumeratorField);
            layout.AddElement(toeDenominatorField);
            layout.AddElement(whitePointField);
        }