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; } }
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>(); } }
void Start() { thisCaController = GameObject.FindObjectOfType <CamerasController>(); }
private void Awake() { instance = this; }