示例#1
0
        /// <inheritoc/>
        protected internal override void Initialize(int layoutIndex)
        {
            if (property != null)
            {
                guiDistributionField              = new GUIFloatDistributionField(new GUIContent(title));
                guiDistributionField.OnChanged   += OnFieldValueChanged;
                guiDistributionField.OnConfirmed += OnFieldValueConfirm;
                guiDistributionField.OnFocusLost += OnFieldValueConfirm;

                layout.AddElement(layoutIndex, guiDistributionField);
            }
        }
示例#2
0
        /// <inheritoc/>
        protected internal override void Initialize(int layoutIndex)
        {
            if (property != null)
            {
                guiDistributionField = new GUIFloatDistributionField(new GUIContent(title));
                guiDistributionField.OnCurveChanged += () =>
                {
                    StartUndo();
                    property.SetValue(guiDistributionField.Value);
                    state |= InspectableState.ModifyInProgress;
                    EndUndo();
                };

                guiDistributionField.OnConstantModified  += (x, y) => OnFieldValueChanged();
                guiDistributionField.OnConstantConfirmed += (rangeComp, vectorComp) =>
                {
                    OnFieldValueConfirm();

                    if (rangeComp == RangeComponent.Min)
                    {
                        StartUndo("min." + vectorComp.ToString());
                    }
                    else
                    {
                        StartUndo("max." + vectorComp.ToString());
                    }
                };
                guiDistributionField.OnConstantFocusChanged += (focus, rangeComp, vectorComp) =>
                {
                    if (focus)
                    {
                        if (rangeComp == RangeComponent.Min)
                        {
                            StartUndo("min." + vectorComp.ToString());
                        }
                        else
                        {
                            StartUndo("max." + vectorComp.ToString());
                        }
                    }
                    else
                    {
                        OnFieldValueConfirm();
                    }
                };

                layout.AddElement(layoutIndex, guiDistributionField);
            }
        }
 private static extern void Internal_create3(GUIFloatDistributionField managedInstance, string style);
 private static extern void Internal_create2(GUIFloatDistributionField managedInstance, LocString labelText, string style);
 private static extern void Internal_create0(GUIFloatDistributionField managedInstance, ref GUIContent labelContent, string style);