예제 #1
0
    public void SetCar(CarData car)
    {
        this.carData = car;
        carInstance  = Instantiate(car.car, Vector3.zero, Quaternion.identity, spawnPoint.transform);

        if (carInstance != null)
        {
            customCamera.target = carInstance.transform;
            CamerasController camerasController = carInstance.GetComponent <CamerasController>();
            camerasController.customCamera = customCamera;
        }
    }
예제 #2
0
 void Start()
 {
     if (brakeLights == null)
     {
         brakeLights = GetComponent <BrakeLights>();
     }
     if (drivetrain == null)
     {
         drivetrain = GetComponent <Drivetrain>();
     }
     if (aerodynamicResistance == null)
     {
         aerodynamicResistance = GetComponent <AerodynamicResistance>();
     }
     if (soundController == null)
     {
         soundController = GetComponent <SoundController>();
     }
     if (carDynamics == null)
     {
         carDynamics = GetComponent <CarDynamics>();
     }
     if (axles == null)
     {
         axles = GetComponent <Axles>();
     }
     if (axisCarController == null)
     {
         axisCarController = GetComponent <AxisCarController>();
     }
     if (carDamage == null)
     {
         carDamage = GetComponent <CarDamage>();
     }
     if (arcader == null)
     {
         arcader = GetComponent <Arcader>();
     }
     if (setup == null)
     {
         setup = GetComponent <Setup>();
     }
     if (bodyRb == null)
     {
         bodyRb = GetComponent <Rigidbody>();
     }
     if (camerasController == null)
     {
         camerasController = GetComponent <CamerasController>();
     }
 }
예제 #3
0
 void Start()
 {
     thisCaController = GameObject.FindObjectOfType <CamerasController>();
 }
예제 #4
0
 private void Awake()
 {
     instance = this;
 }