void DisableCar(bool brake = true) { CarCameras CarCams = m_Car.GetComponent <CarCameras>() as CarCameras; CarCams.showFixedCams = false; m_Car.motorInput = 0.0f; m_Car.brakeInput = brake ? 1.0f : 0; CarSettings Settings = m_Car.GetComponent <CarSettings>() as CarSettings; if (Settings) { Settings.bypassABS = true; } m_Car.readUserInput = false; nitroDown = false; }
void Awake() { carCameras = GetComponent <CarCameras>(); }
private void UpdateTarget() { if (m_targetCams) { if (m_targetCams.MirrorLeft) { m_targetCams.MirrorLeft.enabled = false; } if (m_targetCams.MirrorRight) { m_targetCams.MirrorRight.enabled = false; } if (m_targetCams.MirrorRear) { m_targetCams.MirrorRear.enabled = false; } if (m_scrDriverFreeView) { m_scrDriverFreeView.enabled = false; } } m_targetCams = Target.GetComponent <CarCameras>() as CarCameras; if (m_targetCams.DriverFront) { m_scrDriverFreeView = m_targetCams.DriverFront.GetComponent <CamFreeView>() as CamFreeView; } else { m_scrDriverFreeView = null; } m_scrFixTo.Pos = m_targetCams.DriverFront; m_scrSmoothFollow.target = m_targetCams.CameraLookAtPoint; m_scrSmoothFollow.distance = m_targetCams.viewDistance; m_scrSmoothFollow.height = m_targetCams.viewHeight; m_scrSmoothFollow.rotationDamping = m_targetCams.viewDamping; m_scrSmoothFollow.reset = true; m_scrMouseOrbit.target = m_targetCams.CameraLookAtPoint; m_scrMouseOrbit.distance = m_targetCams.viewDistance; m_scrMouseOrbit.distMinLimit = m_targetCams.viewMinDistance; m_scrMouseOrbit.yMinLimit = m_targetCams.viewMinHeight; m_scrSmoothLookAt.target = m_targetCams.CameraLookAtPoint; if (m_scrMapFollow) { m_scrMapFollow.target = m_targetCams.CameraLookAtPoint; } if (Target2) { CarCameras Target2Cameras; m_scrSmoothLookAtFromPos.pos = m_targetCams.CameraLookAtPoint; m_scrSmoothLookAtFromPos.positionZ = -m_targetCams.viewDistance; m_scrSmoothLookAtFromPos.positionY = m_targetCams.viewHeight / 2.0f; Target2Cameras = Target2.GetComponent <CarCameras>() as CarCameras; if (Target2Cameras) { m_scrSmoothLookAtFromPos.target = Target2Cameras.CameraLookAtPoint; } else { m_scrSmoothLookAtFromPos.target = Target2; } } else { if (m_currCamera == m_numCameras - 1) { SwitchTo(DefaultCamera); } } UpdateMirrors(); }
void Awake() { //Application.targetFrameRate = 30; if (carCamerasController == null) { carCamerasController = Camera.main.GetComponent <CarCamerasController>(); } settingsMenu = GetComponent <SettingsMenu>(); carCameras = Camera.main.GetComponent <CarCameras>(); if (mapCameraController == null) { if (GameObject.FindWithTag("MapCamera")) { mapCameraController = GameObject.FindWithTag("MapCamera").GetComponent <CarCamerasController>(); } else if (GameObject.Find("MapCamera")) { mapCameraController = GameObject.Find("MapCamera").GetComponent <CarCamerasController>(); } } object[] obj = GameObject.FindObjectsOfType(typeof(GameObject)); foreach (object o in obj) { GameObject g = (GameObject)o; if (g.GetComponent <Light>() != null) { mlight = g.GetComponent <Light>(); } } Time.fixedDeltaTime = fixedTimeStep; if (cars.Length == 0) { cars = GameObject.FindGameObjectsWithTag("Car"); } foreach (GameObject car in cars) { if (car != null) { car.SetActive/*Recursively*/ (true); if (car.transform.GetComponent <CarDebug>() != null) { car.transform.GetComponent <CarDebug>().enabled = false; } if (car.transform.GetComponent <Setup>() != null) { car.transform.GetComponent <Setup>().enabled = false; } if (car.transform.GetComponent <CarDynamics>().skidmarks == null) { Skidmarks skidclone; if (skidmarks) { skidclone = Instantiate(skidmarks, Vector3.zero, Quaternion.identity) as Skidmarks; car.transform.GetComponent <CarDynamics>().skidmarks = skidclone; } } } } }
private void UpdateTarget() { if (m_targetCams) { if (m_targetCams.MirrorLeft) m_targetCams.MirrorLeft.enabled = false; if (m_targetCams.MirrorRight) m_targetCams.MirrorRight.enabled = false; if (m_targetCams.MirrorRear) m_targetCams.MirrorRear.enabled = false; if (m_scrDriverFreeView) m_scrDriverFreeView.enabled = false; } m_targetCams = Target.GetComponent<CarCameras>() as CarCameras; if (m_targetCams.DriverFront) m_scrDriverFreeView = m_targetCams.DriverFront.GetComponent<CamFreeView>() as CamFreeView; else m_scrDriverFreeView = null; m_scrFixTo.Pos = m_targetCams.DriverFront; m_scrSmoothFollow.target = m_targetCams.CameraLookAtPoint; m_scrSmoothFollow.distance = m_targetCams.viewDistance; m_scrSmoothFollow.height = m_targetCams.viewHeight; m_scrSmoothFollow.rotationDamping = m_targetCams.viewDamping; m_scrSmoothFollow.reset = true; m_scrMouseOrbit.target = m_targetCams.CameraLookAtPoint; m_scrMouseOrbit.distance = m_targetCams.viewDistance; m_scrMouseOrbit.distMinLimit = m_targetCams.viewMinDistance; m_scrMouseOrbit.yMinLimit = m_targetCams.viewMinHeight; m_scrSmoothLookAt.target = m_targetCams.CameraLookAtPoint; if (m_scrMapFollow) m_scrMapFollow.target = m_targetCams.CameraLookAtPoint; if (Target2) { CarCameras Target2Cameras; m_scrSmoothLookAtFromPos.pos = m_targetCams.CameraLookAtPoint; m_scrSmoothLookAtFromPos.positionZ = -m_targetCams.viewDistance; m_scrSmoothLookAtFromPos.positionY = m_targetCams.viewHeight / 2.0f; Target2Cameras = Target2.GetComponent<CarCameras>() as CarCameras; if (Target2Cameras) m_scrSmoothLookAtFromPos.target = Target2Cameras.CameraLookAtPoint; else m_scrSmoothLookAtFromPos.target = Target2; } else { if (m_currCamera == m_numCameras - 1) SwitchTo(DefaultCamera); } UpdateMirrors(); }
void Awake(){ carCameras = GetComponent<CarCameras>(); }