Esempio n. 1
0
    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);
    }
Esempio n. 2
0
 void HandleBallTimerFinished()
 {
     //Camera.main.GetComponent<BallSpawner>().Spawnball();
     ballSpawn.Invoke();
     Destroy(gameObject);
 }