private void HandleConstraintRowType(ConstraintUtils.ConstraintRow row, int rowIndex, InvokeWrapper wrapper, GUISkin skin) { RowLabel(rowIndex, skin); var rowData = row != null ? row.RowData : null; object value = null; if (wrapper.IsType <float>()) { value = EditorGUILayout.FloatField(wrapper.Get <float>(rowData)); } else if (wrapper.IsType <RangeReal>()) { RangeReal currValue = wrapper.Get <RangeReal>(rowData); currValue.Min = EditorGUILayout.FloatField(currValue.Min, GUILayout.MaxWidth(128)); currValue.Max = EditorGUILayout.FloatField(currValue.Max, GUILayout.MaxWidth(128)); if (currValue.Min > currValue.Max) { currValue.Min = currValue.Max; } value = currValue; } else { } if (wrapper.ConditionalSet(rowData, value)) { EditorUtility.SetDirty(Constraint); } }
public BeginConstraintRowGUI(ConstraintUtils.ConstraintRow row, InvokeWrapper wrapper) { m_guiWasEnabled = UnityEngine.GUI.enabled; if (row != null) { Undo.RecordObject(row.ElementaryConstraint, "RowUpdate"); } UnityEngine.GUI.enabled = m_guiWasEnabled && row != null && row.Valid; }