Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/AtaTrkgl/NaughtyAttributes
Browse files Browse the repository at this point in the history
…into AtaTrkgl-master
  • Loading branch information
dbrizov committed Feb 6, 2022
2 parents 4f07279 + eff7d29 commit 2bba47d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ protected override void OnGUI_Internal(Rect rect, SerializedProperty property, G
return;
}

var attribute = PropertyUtility.GetAttribute<CurveRangeAttribute>(property);
var curveRangeAttribute = (CurveRangeAttribute)attribute;
var curveRanges = new Rect(curveRangeAttribute.Min.x, curveRangeAttribute.Min.y, curveRangeAttribute.Max.x - curveRangeAttribute.Min.x, curveRangeAttribute.Max.y - curveRangeAttribute.Min.y);

EditorGUI.CurveField(
rect,
property,
attribute.Color == EColor.Clear ? Color.green : attribute.Color.GetColor(),
new Rect(attribute.Min.x, attribute.Min.y, attribute.Max.x - attribute.Min.x, attribute.Max.y - attribute.Min.y),
curveRangeAttribute.Color == EColor.Clear ? Color.green : curveRangeAttribute.Color.GetColor(),
curveRanges,
label);

EditorGUI.EndProperty();
Expand Down

0 comments on commit 2bba47d

Please sign in to comment.