SHOW:
|
|
- or go back to the newest paste.
| 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");
|
| 18 | + | // ==>> (OldOne) var drivingScript =car.GetComponent("CarDynamics");
|
| 19 | - | drivingScript.enabled=false; |
| 19 | + | // ==>>(new one) : |
| 20 | var drivingScript =car.GetComponent.<CarDynamics>(); | |
| 21 | // ==>> (Not Working!!!) drivingScript.enabled=false; | |
| 22 | ||
| 23 | for (countDown = countMax; countDown>0;countDown--){
| |
| 24 | guiCountDown.text = countDown.ToString(); | |
| 25 | yield WaitForSeconds(1); | |
| 26 | } | |
| 27 | ||
| 28 | - | } |
| 28 | + | |
| 29 | drivingScript.enabled=true; | |
| 30 | } | |
| 31 | ||
| 32 | ||
| 33 | //error : Assets/StartCountDown.js(18,46): BCE0018: The name 'CarDynamics' does not denote a valid type ('not found'). |