duck

duck

Mar 4th, 2010
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. Vector3 idleWeights = new Vector3(0,1,0);
  2. if (energy > 0.5) {
  3.     idleWeights = Vector3.Lerp( new Vector3(0,0,1), (energy-0.5f)*2 );
  4. } else {
  5.     idleWeights = Vector3.Lerp( new Vector3(1,0,0), energy*2 );
  6. }
  7. animation["lowIdle"].weight = idleWeights.x;
  8. animation["normalIdle"].weight = idleWeights.y;
  9. animation["highIdle"].weight = idleWeights.z;
Add Comment
Please, Sign In to add comment