UnityEngine.AnimationCurve.Linear C# (CSharp) 메소드

Linear() 공개 정적인 메소드

A straight Line starting at timeStart, valueStart and ending at timeEnd, valueEnd.

public static Linear ( float timeStart, float valueStart, float timeEnd, float valueEnd ) : AnimationCurve
timeStart float The start time for the linear curve.
valueStart float The start value for the linear curve.
timeEnd float The end time for the linear curve.
valueEnd float The end value for the linear curve.
리턴 AnimationCurve
        public static AnimationCurve Linear(float timeStart, float valueStart, float timeEnd, float valueEnd)
        {
            float outTangent = (valueEnd - valueStart) / (timeEnd - timeStart);
            Keyframe[] keys = new Keyframe[] { new Keyframe(timeStart, valueStart, 0f, outTangent), new Keyframe(timeEnd, valueEnd, outTangent, 0f) };
            return new AnimationCurve(keys);
        }

Usage Example

예제 #1
0
 public static AnimationCurve Constant(float timeStart, float timeEnd, float value)
 {
     return(AnimationCurve.Linear(timeStart, value, timeEnd, value));
 }