/// <summary> /// Transitions the GameObject to a scale relative to its current scale. /// </summary> /// <param name="gameObject">The GameObject to modify.</param> /// <param name="targetScale">The target scale, as a multiple of the object's current scale; represented as a single float. ex. 1.1f is equivalent to Vector3(1.1f, 1.f, 1.f).</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 SetRelativeScale(this GameObject gameObject, float targetScale, float duration = Defaults._duration, Easing easing = Defaults._easing, string cubicBezier = Defaults._cubicBezier) { Vector3 targetVector3Scale = new Vector3(targetScale, targetScale, targetScale); CrayonRouter.TweenScale(gameObject, targetVector3Scale, duration, easing, false, true, cubicBezier); }
/// <summary> /// Transitions the GameObject to a specified localScale. /// </summary> /// <param name="gameObject">The GameObject to modify.</param> /// <param name="targetScale">The target localScale.</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 SetScale(this GameObject gameObject, Vector3 targetScale, float duration = Defaults._duration, Easing easing = Defaults._easing, string cubicBezier = Defaults._cubicBezier) { CrayonRouter.TweenScale(gameObject, targetScale, duration, easing, false, false, cubicBezier); }