Пример #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        DeathZoneBehaviour dz = collision.gameObject.GetComponent <DeathZoneBehaviour>();

        if (dz != null)
        {
            //ball enterd the dead zone
            BallManager.SP.BallDeath(this);
        }
    }
Пример #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        //If it hits the paddle or the deadthzone
        DeathZoneBehaviour dz = collision.gameObject.GetComponent <DeathZoneBehaviour>();

        if (dz != null)
        {
            //Remove here, aka place in the new queueue
            gameObject.SetActive(false);

            return;
        }

        PlayerBehaviour pb = collision.gameObject.GetComponent <PlayerBehaviour>();

        if (pb != null)
        {
            //Apply powerup
            pb.PowerUp(this);
            return;
        }
    }