示例#1
0
        /// <summary>
        ///     Animates the scale of a GameObject, relative to it's original scale, with a Vector3AnimationCurve.
        /// </summary>
        /// <param name="gameObject">GameObject to scale.</param>
        /// <param name="animationCurve">Vector3AnimationCurve to evaluate.</param>
        /// <returns>Coroutine</returns>
        public static Coroutine ScaleRelative(GameObject gameObject, Vector3AnimationCurve animationCurve)
        {
            var animationData = gameObject.AddOrGetComponent <AnimationData>();

            return(StartCoroutine(gameObject, "ScaleRelative",
                                  Loop(gameObject, "ScaleRelative", animationCurve.IsLooping(), animationCurve.MaxTime(),
                                       elapsedTime => ScaleRelative(gameObject, animationCurve, elapsedTime, animationData))));
        }
示例#2
0
 /// <summary>
 ///     Animates the scale of a GameObject with a Vector3AnimationCurve.
 /// </summary>
 /// <param name="gameObject">GameObject to scale.</param>
 /// <param name="animationCurve">Vector3AnimationCurve to evaluate.</param>
 /// <returns>Coroutine</returns>
 public static Coroutine Scale(GameObject gameObject, Vector3AnimationCurve animationCurve)
 {
     return(StartCoroutine(gameObject, "Scale",
                           Loop(gameObject, "Scale", animationCurve.IsLooping(), animationCurve.MaxTime(),
                                elapsedTime => Scale(gameObject, animationCurve, elapsedTime))));
 }
示例#3
0
        /// <summary>
        /// Animates the position of a GameObject with a Vector3AnimationCurve.
        /// </summary>
        /// <param name="gameObject">GameObject to move.</param>
        /// <param name="animationCurve">Vector3AnimationCurve to evaluate.</param>
        /// <returns>Coroutine</returns>

        public static Coroutine Position(GameObject gameObject, Vector3AnimationCurve animationCurve)
        {
            return(StartCoroutine(gameObject, "Position",
                                  Loop(gameObject, "Position", animationCurve.IsLooping(), animationCurve.MaxTime(),
                                       (elapsedTime) => Position(gameObject, animationCurve, elapsedTime))));
        }