Example #1
0
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.tag == "Rock")
        {
            _player.SpeedCut();
        }

        if (collision.collider.tag == "Wall")
        {
            _player.ChangeDirectionRotation();
        }

        if (collision.collider.GetComponent <Delimiter>())
        {
            if (collision.collider.tag == "Rock")
            {
                _player.TakeAwaySpeedRotation();
            }
            else
            {
                _player.AddSpeedRotation();
            }
        }
    }