TO SQUASH: Added FruitBall prefab, animation, and script. Updated BallSpawner to spawn FruitBalls.
This commit is contained in:
@@ -30,7 +30,8 @@ public class BallSpawner : MonoBehaviour
|
||||
ballQueue.Enqueue(() => SpawnBasicBall());
|
||||
ballQueue.Enqueue(() => SpawnBasicBall());
|
||||
ballQueue.Enqueue(() => SpawnBasicBall());
|
||||
ballQueue.Enqueue(() => SpawnBasicBall());
|
||||
ballQueue.Enqueue(() => SpawnFruitBall());
|
||||
ballQueue.Enqueue(() => SpawnFruitBall());
|
||||
|
||||
StartCoroutine(SpawnBalls());
|
||||
}
|
||||
@@ -47,6 +48,18 @@ public class BallSpawner : MonoBehaviour
|
||||
Instantiate(basicBallPrefab, spawnPosition, Quaternion.identity);
|
||||
}
|
||||
|
||||
private void SpawnFruitBall()
|
||||
{
|
||||
if (fruitBallPrefab == null || gameBoard == null)
|
||||
{
|
||||
Debug.LogWarning("BallSpawner: Missing fruitBallPrefab or gameBoard reference.");
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 spawnPosition = GetRandomPositionInsideGameBoard();
|
||||
Instantiate(fruitBallPrefab, spawnPosition, Quaternion.identity);
|
||||
}
|
||||
|
||||
private Vector3 GetRandomPositionInsideGameBoard()
|
||||
{
|
||||
Bounds bounds;
|
||||
|
||||
Reference in New Issue
Block a user