Beispiel #1
0
    protected void OnCollisionEnter2D(Collision2D other)
    {
        if (other.gameObject.tag == "Bounds")
        {
            if (movement.speedMagnitude > 7f)
            {
                playWallCollision();
                cam_shaker.magnitude  = movement.speedMagnitude;
                cam_shaker.shakeTimer = cam_shaker.duration;
            }
            movement.BoundCollision();
        }

        if (other.gameObject.tag == "Player1" || other.gameObject.tag == "Player2")
        {
            cam_shaker.magnitude  = movement.speedMagnitude / 3f;
            cam_shaker.shakeTimer = cam_shaker.duration;
            movement.playerCollision();
        }
    }