private void SetHoleBlock() { for (int i = 0; i < axisIndex; i++) { int j = 0; int k = 0; while (j < blockSize) // negative { GameObject block = Instantiate(holeBlockPrefab) as GameObject; HoleBlock holeBlock = block.GetComponent <HoleBlock>(); holeBlock.Initialize(i, j, blockSize); switchController[i, 0].holeGroup[j] = holeBlock; j++; } while (k < blockSize) // positive { GameObject block = Instantiate(holeBlockPrefab) as GameObject; HoleBlock holeBlock = block.GetComponent <HoleBlock>(); holeBlock.Initialize(i, blockSize, k); switchController[i, 1].holeGroup[k] = holeBlock; k++; } } }
private void SetHoleBlock(int blockSize) //axisIndex: 0 == x, 1 == y, 2 == z { for (int i = 0; i < _axisIndex; i++) { int j = 0; int k = 0; while (j < blockSize) // negative { GameObject block = Instantiate(holeBlockPrefab) as GameObject; HoleBlock holeBlock = block.GetComponent <HoleBlock>(); holeBlock.Initialize(i, j, blockSize); holeArray[i, 0, j] = holeBlock; j++; } while (k < blockSize) // positive { GameObject block = Instantiate(holeBlockPrefab) as GameObject; HoleBlock holeBlock = block.GetComponent <HoleBlock>(); holeBlock.Initialize(i, blockSize, k); holeArray[i, 1, k] = holeBlock; k++; } } }