Advertisement
mitchellvette

Untitled

Feb 27th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. private var timer : int;
  2. var timeDown : int = 10;
  3. var timerSubtract : int;
  4.  
  5. function Update(){
  6.  
  7. if(timerSubtract != 0){
  8. RunTimer();
  9. }
  10.  
  11. else if(timerSubtract == 0){
  12. TimerStop();
  13. }
  14.  
  15. if(timer <= timeDown){
  16. timerSubtract = timeDown - timer;
  17. }
  18. else {
  19. timerSubtract = 0;
  20. }
  21.  
  22. Debug.Log(timer);
  23.  
  24. if(timerSubtract <= 0 && transform.position.x < -3){
  25.  
  26. transform.position.x += 10 * Time.deltaTime;
  27.  
  28. }
  29.  
  30. }
  31.  
  32. function RunTimer(){
  33. timer = Time.time;
  34. }
  35.  
  36. function TimerStop(){
  37. timer = 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement