Пример #1
0
        public virtual void EnablePlayerControll(bool enable)
        {
            nitro.enabled      = enable;
            controller.enabled = enable;


            //resetTime = Time.time;
            for (int i = 0; i < smokeParticles.Count; i++)
            {
                smokeParticles[i].Play();
            }
            input.enabled         = enable;
            airController.enabled = enable;
            tricks.enabled        = enable;

            if (enable)
            {
                _audioService.EngineEmitterPlay();
            }
            else
            {
                _audioService.CarDropEmitterStop();
                nitro.stopParticle();
                _audioService.EngineEmitterStop();
            }

            _rb.drag = carDrag;

            isPlayer = enable;

            MassDiver = controller.wheels[0].wheelCollider.suspensionSpring.spring / 40;
        }