Created
February 17, 2014 08:42
-
-
Save Azzizi/9046957 to your computer and use it in GitHub Desktop.
Using Mathf.lerp()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class whatever : Monobehaviour | |
{ | |
float lerpTimer = 0f; | |
void Update() | |
{ | |
if ( /* The lerp is happening */) | |
{ | |
lerpTimer += Time.deltatime; | |
alpha = Mathf.lerp(start, end, lerpTimer/duration); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment