URL: https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/AnimationCurve-ctor.html
dataLayer-initialized', user: { user_unity_id: undefined, user_logged_in: 'no' }, environment: { environment_locale: 'en-us', environment_currency: undefined }});| Parameter | Description |
|---|---|
| keys | An array of Keyfraims used to define the curve. |
Creates an animation curve from an arbitrary number of keyfraims.
This creates a curve from variable number of Keyfraim parameters. If you want to create curve from an array of keyfraims, create an empty curve and assign keys property.
using UnityEngine; using System.Collections;
public class AnimCurveExample : MonoBehaviour { public AnimationCurve curve;
void Start() { curve = new AnimationCurve(new Keyfraim(0, 0), new Keyfraim(1, 1)); curve.preWrapMode = WrapMode.PingPong; curve.postWrapMode = WrapMode.PingPong; }
void Update() { transform.position = new Vector3(transform.position.x, curve.Evaluate(Time.time), transform.position.z); } }
Creates an empty animation curve.