TO SQUASH: Added FruitBall prefab, animation, and script. Updated BallSpawner to spawn FruitBalls.

This commit is contained in:
2026-08-03 00:02:04 -04:00
parent b073fc0785
commit f3627df2e9
18 changed files with 1258 additions and 4 deletions
+14 -1
View File
@@ -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;