Ejemplo n.º 1
0
    public override void OnTouchPlayer(PlayerBall player)
    {
        if (LevelManager.instance.isGameOver)
        {
            return;
        }

        player.AddScore(score);
        player.SetColor(currentColor);

        HandleDamage(1);
    }
Ejemplo n.º 2
0
    public override void OnTouchPlayer(PlayerBall player)
    {
        player.SetColor(currentColor);
        if (touchSfx != null)
        {
            SoundManager.instance.PlaySound2D(touchSfx);
        }

        /*float xVel = Mathf.Abs(player.rbd2.velocity.x);
         * float yVel = Mathf.Abs(player.rbd2.velocity.y);
         *
         * if (xVel > yVel)
         * {
         *  player.rbd2.velocity = new Vector2(player.rbd2.velocity.x, -1 * player.rbd2.velocity.y) * 3;
         * } else if (yVel > xVel)
         * {
         *  player.rbd2.velocity = new Vector2(-1 * player.rbd2.velocity.x, player.rbd2.velocity.y) * 3;
         * }*/
    }