/// <summary> /// Constructs a new set of GUI elements for inspecting the limit object. /// </summary> /// <param name="limit">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 LimitLinearGUI(LimitLinear limit, GUILayout layout, SerializableProperties properties) { limitData = limit; limitExtentField.OnChanged += x => { limitData.extent = x; MarkAsModified(); }; limitExtentField.OnFocusLost += ConfirmModify; layout.AddElement(limitExtentField); limitCommonGUI = new LimitCommonGUI("linear", limit.GetBase(), layout, properties); limitCommonGUI.OnChanged += x => MarkAsModified(); limitCommonGUI.OnConfirmed += ConfirmModify; }
/// <summary> /// Constructs a new set of GUI elements for inspecting the limit object. /// </summary> /// <param name="limit">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 LimitConeRangeGUI(LimitConeRange limit, GUILayout layout, SerializableProperties properties) { this.limitData = limit; yLimitAngleField.OnChanged += x => { limitData.yLimitAngle = new Degree(x); MarkAsModified(); }; yLimitAngleField.OnFocusLost += ConfirmModify; zLimitAngleField.OnChanged += x => { limitData.zLimitAngle = new Degree(x); MarkAsModified(); }; zLimitAngleField.OnFocusLost += ConfirmModify; layout.AddElement(yLimitAngleField); layout.AddElement(zLimitAngleField); limitCommonGUI = new LimitCommonGUI("coneRange", limit.GetBase(), layout, properties); limitCommonGUI.OnChanged += x => MarkAsModified(); limitCommonGUI.OnConfirmed += ConfirmModify; }
/// <summary> /// Constructs a new set of GUI elements for inspecting the limit object. /// </summary> /// <param name="limit">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 LimitAngularRangeGUI(LimitAngularRange limit, GUILayout layout, SerializableProperties properties) { this.limitData = limit; limitLowerField.OnChanged += x => { limitData.lower = new Degree(x); MarkAsModified(); }; limitLowerField.OnFocusLost += ConfirmModify; limitUpperField.OnChanged += x => { limitData.upper = new Degree(x); MarkAsModified(); }; limitUpperField.OnFocusLost += ConfirmModify; layout.AddElement(limitLowerField); layout.AddElement(limitUpperField); limitCommonGUI = new LimitCommonGUI("angularRange", limit.GetBase(), layout, properties); limitCommonGUI.OnChanged += x => MarkAsModified(); limitCommonGUI.OnConfirmed += ConfirmModify; }