Advertisement
aokmikey

update ish

Nov 25th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. var1 = varOverTime( 1, 0.2, 5);
  2.  
  3. // thread pass though
  4. varOverTime( start, time, NewValue )
  5. {
  6.     self thread func_varOverTime( start, time, NewValue );
  7. }
  8.  
  9. // logically var1 would be self.
  10. func_varOverTime( start, Time, NewValue )
  11. {
  12.     currentVal = start;
  13.     // pos or neg
  14.     if( start > NewValue )
  15.     {
  16.         while( NewValue > currentVal && currentVal != NewValue )
  17.         {
  18.             currentVal -= 0.01;
  19.             self = currentVal;
  20.             wait time;
  21.         }
  22.     }
  23.     else
  24.     {
  25.         while( currentVal < NewValue )
  26.         {
  27.             currentVal -= 0.01;
  28.             self = currentVal;
  29.             wait time;
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement