public void Move(int x, int y, Ball.Direction dir) { foreach (var t in items) { if (t.selected) { t.move(x, y, dir); } } }
private void OnScore(int who) { GameObject nextStart = player; Ball.Direction newDir = Ball.Direction.TO_PLAYER; if (who == PLAYER) { playerScore++; playerScoreText.text = playerScore.ToString(); } else { opponentScore++; opponentScoreText.text = opponentScore.ToString(); nextStart = opponent; newDir = Ball.Direction.TO_OPPONENT; } ball.GetComponent <Ball>().ResetBall(nextStart, newDir); }