Quantcast
Viewing latest article 1
Browse Latest Browse All 7

Answer by Statement

What way do you intend to use it?

Here's an example usage for animating a light turn on through Evaluate. You edit the AnimationCurve in the inspector. You can also give it some simple default value through Linear and EaseInOut.

var intensity : AnimationCurve;

yield AnimateIntensity();

function AnimateIntensity() {       
    var duration = intensity[intensity.length - 1].time;
    var timer = 0.0f;
    while (timer < duration) {
        timer = Mathf.MoveTowards(timer, duration, Time.deltaTime);
        light.intensity = intensity.Evaluate(timer);
        yield;
    }
}

Viewing latest article 1
Browse Latest Browse All 7

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>