Ejemplo n.º 1
0
        private void Awake()
        {
            // get the car controller reference
            m_CarController = GetComponent <CarController>();

            // give the random perlin a random value
            m_RandomPerlin = Random.value * 100;

            m_Rigidbody = GetComponent <Rigidbody>();

            main = GetComponent <CarMainController>();
        }
Ejemplo n.º 2
0
    private void AddCar()
    {
        Vertex     vertex = roads.GetRandomRespawn();
        GameObject obj    = Instantiate(car, vertex.transform.position, Quaternion.identity);

        obj.transform.parent = transform;
        CarMainController ctrl = obj.GetComponent <CarMainController>();

        ctrl.Setup(vertex, roads);
        count++;
        ui.SetCars(count);
    }