Exemplo n.º 1
0
    void OnTriggerEnter(Collider other)
    {
        Debug.Log("Collided With: " + other.gameObject.tag);
        if (other.gameObject.CompareTag("SouthWall") || other.gameObject.CompareTag("NorthWall"))
        {
            vy = -vy;
        }
        else if (other.gameObject.CompareTag("EastWall"))
        {
            vx = -vx;
            transform.position = new Vector3(0, 0, 0);
            score.IncScore('e');
        }
        else if (other.gameObject.CompareTag("WestWall"))
        {
            vx = -vx;
            transform.position = new Vector3(0, 0, 0);
            score.IncScore('w');
        }

        if (other.gameObject.CompareTag("Paddle"))
        {
            vx = -vx;
            vx = vx * 1.08f;
        }
    }