private void onHitPaddle(GameObject ball, Collider2D paddle) { if (Random.value <= 0.1f) { shadowBalls.Add(ShadowBall.CreateShadowBall(new Vector2(ball.transform.position.x, ball.transform.position.y + UnityEngine.Random.Range(-1.2f, 1.2f)))); } }
public override void Activate(Ball ball, Player playerPaddle) { base.Activate(ball, playerPaddle); ball.OnHitPaddle += this.onHitPaddle; shadowBalls.Add(ShadowBall.CreateShadowBall(new Vector2(ball.transform.position.x, ball.transform.position.y + UnityEngine.Random.Range(-1.2f, 1.2f)))); LevelsToLast = 1; }