Advertisement
Loadus

Points value split to Chars

Nov 10th, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function PointsRefresh () {
  2.  
  3.         var a : float = 0.0;
  4.         var duration : float = 2;
  5.        
  6.         while (a < 1.0)
  7.         {
  8.             var pointsTrans : int = Mathf.Lerp(previousPoints, playerPoints, Mathf.SmoothStep(0.0, 1.0, a));
  9.            
  10.             var splitPoints = pointsTrans.ToString().ToCharArray();
  11.            
  12.             for (var i : int = 0; i < splitPoints.length; i++)
  13.             {
  14.                 var j = splitPoints.length - i - 1;
  15.                
  16.                 if(pointsKeeper[j] != null)
  17.                 {
  18.                     pointsKeeper[j].GetComponent(fontData).Refresh(32 + Char.GetNumericValue(splitPoints[i]));
  19.                     print(playerPoints);
  20.                 }
  21.             }
  22.            
  23.             a += Time.deltaTime * duration;
  24.             yield WaitForSeconds (1.0 / 60);
  25.  
  26.         }
  27.        
  28.         previousPoints = playerPoints;
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement