Пример #1
0
 private void Start()
 {
     rigidbody          = GetComponent <Rigidbody>();
     main               = GameObject.Find("GameController").GetComponent <MainScript>();
     mainTree           = GetComponent <MainTreeScript>();
     leftPoints         = main.routes[routeIndex].leftPoints;
     rightPoints        = main.routes[routeIndex].rightPoints;
     heldRightLaneSpeed = rightLaneSpeed;
 }
Пример #2
0
 private void Start()
 {
     car = GetComponent <CarScript>();
     GameObject[] allCars = GameObject.FindGameObjectsWithTag("Car");
     foreach (GameObject car in allCars)
     {
         if (car != this.gameObject)
         {
             cars.Add(car.GetComponent <CarScript>());
         }
     }
     mainTree = GetComponent <MainTreeScript>();
 }
Пример #3
0
 private void Start()
 {
     car      = GetComponent <CarScript>();
     mainTree = GetComponent <MainTreeScript>();
 }