SetGradientAsColor() public static method

public static SetGradientAsColor ( UnityEditor.SerializedProperty gradientProp, Color color ) : void
gradientProp UnityEditor.SerializedProperty
color Color
return void
Beispiel #1
0
        private static void GUIGradientAsColor(Rect rect, SerializedProperty gradientProp)
        {
            bool changed = GUI.changed;

            GUI.changed = false;
            Color color = SerializedMinMaxGradient.GetGradientAsColor(gradientProp);

            color = EditorGUI.ColorField(rect, color, false, true);
            if (GUI.changed)
            {
                SerializedMinMaxGradient.SetGradientAsColor(gradientProp, color);
            }
            GUI.changed |= changed;
        }