示例#1
0
    private void OnTriggerEnter(Collider other)
    {
        //ANOTHER CAR ZONE
        if (other.gameObject.layer == 7)
        {
            ReduceSpeed();
            Gm.ReduceAllLevelOtherCarsSpeed();
            _km.OpenKeyboard();
            _uiManager.ShowWord();
            _soundManager.SetPitch(_soundManager.drivingSound, -0.1f);
            _soundManager.CreateSoundAndDestroy(_soundManager.slowDownSound, 1f, _camera.transform);
            Gm.TutorialGameInTime(1f);
        }

        //ANOTHER CAR
        if (other.gameObject.layer == 6)
        {
            Gm.LoseGame();
            NullifyVelocity();
            SetStartAnim(false);
            SetLoseAnim();
            _soundManager.Vibrate();
            _soundManager.CreateSoundAndDestroy(_soundManager.carSkidSound, 0.7f, _camera.transform);
            _soundManager.CreateSoundAndDestroy(_soundManager.hitSound, 1f, _camera.transform);
            _km.CloseKeyboard();
            other.GetComponent <OtherCarsController>().SetLoseAnim();
        }
    }