Ejemplo n.º 1
0
        /// <summary>
        /// This function eases to a target with two floats.
        /// </summary>
        /// <param name="current"></param>
        /// <param name="target"></param>
        /// <param name="percentLeftAfter1Second"></param>
        /// <returns></returns>
        public static float Slide(float current, float target, float percentLeftAfter1Second)
        {
            float p = 1 - Mathf.Pow(percentLeftAfter1Second, Time.deltaTime);

            return(AnimMath.Lerp(current, target, p));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This function eases between two quaternions.
        /// </summary>
        /// <param name="current"></param>
        /// <param name="target"></param>
        /// <param name="percentLeftAfter1Second"></param>
        /// <returns></returns>
        public static Quaternion Slide(Quaternion current, Quaternion target, float percentLeftAfter1Second = .05f)
        {
            float p = 1 - Mathf.Pow(percentLeftAfter1Second, Time.deltaTime);

            return(AnimMath.Lerp(current, target, p));
        }