private void CreateBall(int x, int y) { Transform BallTransform; AddBall addBall = Instantiate(addBallPrefab); addBall.OnCollision += AddBallCollision; BallTransform = addBall.transform; BallTransform.SetParent(gridContainer); BallTransform.localPosition = GetPositionFromModel(x, y); BallTransform.localScale *= stepX; shapes.Add(BallTransform); }
private void AddBallCollision(AddBall collision) { shapes.Remove(collision.transform); ballsToAdd++; }