Version: 2017.1

KeyframeConstructor

Cambiar al Manual
public Keyframe (float time, float value);

Descripción

Create a keyframe.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { private AnimationCurve anim; private Keyframe[] ks; void Start() { ks = new Keyframe[50]; int i = 0; while (i < ks.Length) { ks[i] = new Keyframe(i, Mathf.Sin(i)); i++; } anim = new AnimationCurve(ks); } void Update() { transform.position = new Vector3(Time.time, anim.Evaluate(Time.time), 0); } }

public Keyframe (float time, float value, float inTangent, float outTangent);

Descripción

Create a keyframe.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { private AnimationCurve anim; private Keyframe[] ks; void Start() { ks = new Keyframe[50]; int i = 0; while (i < ks.Length) { ks[i] = new Keyframe(i, Mathf.Sin(i), 90, 90); i++; } anim = new AnimationCurve(ks); } void Update() { transform.position = new Vector3(Time.time, anim.Evaluate(Time.time), 0); } }