private void SpawnBall(Vector2 levelCenter, Vector2 normalizedDirection) { _ball = Instantiate(ball, levelCenter, Quaternion.identity); _ball.GetComponent <Rigidbody2D>().velocity = normalizedDirection * ball.GetComponent <Ball>().ballSpeed; BallSpawn?.Invoke(_ball); }
void HandleBallTimerFinished() { //Camera.main.GetComponent<BallSpawner>().Spawnball(); ballSpawn.Invoke(); Destroy(gameObject); }