Advertisement
aokmikey

ChangeVarOvetime

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