public void InitPanels() { Transform firstPersonTransform = _transform.Find("Chassis/FirstPerson"); SystemsPanel = new SystemsPanel(firstPersonTransform); GearPanel = new GearPanel(firstPersonTransform); _compassPanel = new CompassPanel(firstPersonTransform); RadarPanel = new RadarPanel(this, firstPersonTransform); }
private void Explode() { _rigidBody.AddForce(Vector3.up * _rigidBody.mass * 5f, ForceMode.Impulse); CarInput carInputController = GetComponent <CarInput>(); if (carInputController != null) { Destroy(carInputController); } AudioSource explosionSource = _cacheManager.GetAudioSource(_gameObject, "xcar"); if (explosionSource != null) { explosionSource.volume = 0.9f; explosionSource.Play(); } EngineRunning = false; Destroy(_engineLoopSound); Destroy(_engineStartSound); Movement.Destroy(); Movement = null; AI = null; WeaponsController = null; SpecialsController = null; SystemsPanel = null; GearPanel = null; _compassPanel = null; RadarPanel = null; Destroy(transform.Find("FrontLeft").gameObject); Destroy(transform.Find("FrontRight").gameObject); Destroy(transform.Find("BackLeft").gameObject); Destroy(transform.Find("BackRight").gameObject); }