private void RetrySpawn() { while (numBlocks < maxBlocks) { if (debugMode) { Debug.Log("RetrySpawn"); } int row = Random.Range(1, boardSize + 1); int col = Random.Range(1, boardSize + 1); if (board [row, col].block == null) { spawnBlock.SetBoardPosition(row, col); spawnBlock.Retry(); break; } } }
private void SpawnSpawner() { while (numBlocks < maxBlocks) { if (debugMode) { Debug.Log("SpawnSpawner"); } int row = Random.Range(1, boardSize + 1); int col = Random.Range(1, boardSize + 1); if (board [row, col].block == null) { spawnBlock = ((GameObject)Instantiate(spawnBlockRes, Vector2.zero, Quaternion.identity)).GetComponent <SpawnBlock> (); spawnBlock.SetBlockProperties(nextBlock.color, nextBlock.shape); spawnBlock.SetBoardPosition(row, col); break; } } }
private void SpawnSpawner () { while (numBlocks < maxBlocks) { if (debugMode) { Debug.Log ("SpawnSpawner"); } int row = Random.Range (1, boardSize + 1); int col = Random.Range (1, boardSize + 1); if (board [row, col].block == null) { spawnBlock = ((GameObject)Instantiate (spawnBlockRes, Vector2.zero, Quaternion.identity)).GetComponent<SpawnBlock> (); spawnBlock.SetBlockProperties (nextBlock.color, nextBlock.shape); spawnBlock.SetBoardPosition (row, col); break; } } }