Guest User

Untitled

a guest
Aug 6th, 2012
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma strict
  2. var guiCountDown :GUIText;
  3. var countMax : int;
  4. private var countDown : int;
  5.  
  6.  
  7. function Start(){
  8.     guiCountDown.enabled=true;
  9.     GameBegin();
  10. }
  11.  
  12. function Update () {
  13.  
  14. }
  15.  
  16. function GameBegin(){
  17.     var car =GameObject.Find("Car");
  18.     var drivingScript =car.GetComponent("CarDynamics");
  19.     drivingScript.enabled=false;
  20.    
  21.     for (countDown = countMax; countDown>0;countDown--){
  22.         guiCountDown.text = countDown.ToString();
  23.         yield WaitForSeconds(1);
  24.     }
  25.  
  26.     guiCountDown.enabled=false;
  27.     drivingScript.enabled=true;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment