/// <summary> /// Transitions the albedo color of the GameObject, maintaining all other Material properties. /// </summary> /// <param name="gameObject">The GameObject to modify.</param> /// <param name="hexColor">The target color to which the GameObject will transition, as a hex value ("#FF0000").</param> /// <param name="duration">The duration of the transition.</param> /// <param name="easing">Easing function that the transition should follow.</param> /// <param name="cubicBezier">If using Easing.Custom, this is the cubic bezier curve that defines the easing function, in the format P0,P1,P2,P3.</param> public static void SetColor(this GameObject gameObject, string hexColor, float duration = Defaults._duration, Easing easing = Defaults._easing, string cubicBezier = Defaults._cubicBezier) { Color color; ColorUtility.TryParseHtmlString(hexColor, out color); CrayonRouter.TweenColor(gameObject, color, Defaults._duration, Defaults._easing, Defaults._cubicBezier); }
/// <summary> /// Transitions the albedo color of the GameObject, maintaining all other Material properties. /// </summary> /// <param name="gameObject">The GameObject to modify.</param> /// <param name="color">The target color to which the GameObject will transition.</param> /// <param name="duration">The duration of the transition.</param> /// <param name="easing">Easing function that the transition should follow.</param> /// <param name="cubicBezier">If using Easing.Custom, this is the cubic bezier curve that defines the easing function, in the format P0,P1,P2,P3.</param> public static void SetColor(this GameObject gameObject, Color color, float duration = Defaults._duration, Easing easing = Defaults._easing, string cubicBezier = Defaults._cubicBezier) { CrayonRouter.TweenColor(gameObject, color, duration, easing, cubicBezier); }