// Draws the elements on the list void DrawPointElement(Rect r, int i, bool isActive, bool isFocused) { r.yMin += 1; r.yMax -= 2; SerializedProperty prop = propPolyPoints.GetArrayElementAtIndex(i); SerializedProperty pPoint = prop.FindPropertyRelative(nameof(PolylinePoint.point)); SerializedProperty pThickness = prop.FindPropertyRelative(nameof(PolylinePoint.thickness)); SerializedProperty pColor = prop.FindPropertyRelative(nameof(PolylinePoint.color)); ShapesUI.PosThicknessColorField(r, pPoint, pThickness, pColor); pThickness.floatValue = Mathf.Max(0.001f, pThickness.floatValue); // Make sure it's never 0 or under }
// Draws the elements on the list void DrawPointElement(Rect r, int i, bool isActive, bool isFocused) { r.yMin += 1; r.yMax -= 2; SerializedProperty prop = propPoints.GetArrayElementAtIndex(i); SerializedProperty pPoint = prop.FindPropertyRelative(nameof(PolylinePoint.point)); SerializedProperty pThickness = prop.FindPropertyRelative(nameof(PolylinePoint.thickness)); SerializedProperty pColor = prop.FindPropertyRelative(nameof(PolylinePoint.color)); using (var chChk = new EditorGUI.ChangeCheckScope()) { ShapesUI.PosThicknessColorField(r, pPoint, pThickness, pColor, colorEnabled: true, showZ); if (chChk.changed) { pThickness.floatValue = Mathf.Max(0.001f, pThickness.floatValue); // Make sure it's never 0 or under } } }