fix: null guard for unassigned LevelDefinition
This commit is contained in:
@@ -30,6 +30,13 @@ namespace Infrastructure.Unity
|
||||
|
||||
public IEnumerator GenerateAsync(SoundManager soundManager, TileRegistry registry, CameraController camera, RumbleManager rumble, Action onComplete)
|
||||
{
|
||||
if (levelDefinition == null)
|
||||
{
|
||||
Debug.LogError("LevelGenerator: levelDefinition is not assigned. Assign a LevelDefinition asset in the Inspector.");
|
||||
onComplete?.Invoke();
|
||||
yield break;
|
||||
}
|
||||
|
||||
_tilePool = new TilePool(tilePrefab, transform);
|
||||
|
||||
var stopwatch = new Stopwatch();
|
||||
|
||||
Reference in New Issue
Block a user