/// <summary> /// Changes the scale of a GameObject, relative to it's original scale, to the evaluated Vector3 calculated from a Vector3AnimationCurve object. /// </summary> /// <param name="gameObject">GameObject to scale.</param> /// <param name="animationCurve">Vector3AnimationCurve to evaluate.</param> /// <param name="elapsedTime">The time elapsed since the animation started.</param> /// <param name="animationData">AnimationData object containing cached transform data.</param> /// <returns>void</returns> public static void ScaleRelative(GameObject gameObject, Vector3AnimationCurve animationCurve, float elapsedTime, AnimationData animationData) { gameObject.transform.localScale = animationData.TransformData.Scale + animationCurve.Evaluate(elapsedTime); }