// Init rigidbody, center of mass, wheels and more void Start() { #if MULTIOSCONTROLS Debug.Log("[ACP] Using MultiOSControls"); #endif var view = noesisCamera.GetComponent <NoesisView>().Content; var telemetryview = (TelemetryScreenView)view.FindName("telemetryScreenView"); _context = (TelemetryScreenViewModel)telemetryview.DataContext; if (boostClip != null) { boostSource.clip = boostClip; } boost = maxBoost; _rb = GetComponent <Rigidbody>(); spawnPosition = transform.position; spawnRotation = transform.rotation; if (_rb != null && centerOfMass != null) { _rb.centerOfMass = centerOfMass.localPosition; } wheels = GetComponentsInChildren <WheelCollider>(); // Set the motor torque to a non null value because 0 means the wheels won't turn no matter what foreach (WheelCollider wheel in wheels) { wheel.motorTorque = 0.0001f; } }
void Start() { var view = noesisCamera.GetComponent <NoesisView>().Content; var telemetryview = (TelemetryScreenView)view.FindName("telemetryScreenView"); _context = (TelemetryScreenViewModel)telemetryview.DataContext; }