private void Awake() { ball = BallControl.Instance; powerUpTransform = GetComponent <Transform>(); yBoundaryOrigin = player1.yBoundary; player1Transform = player1.GetComponent <Transform>(); player2Transform = player2.GetComponent <Transform>(); playerOriginScale = player1Transform.localScale; // Make random position of power up powerUpTransform.position = new Vector2(Random.Range(-xBoundary, xBoundary), Random.Range(-yBoundaryOrigin, yBoundaryOrigin)); }
public int Score => score; // Getter score private void Start() { ball = BallControl.Instance; rb2D = GetComponent <Rigidbody2D>(); }