private void CreateBalls(CubeModel data) { for (int x = 0; x < data.X_SIZE; x++) { for (int y = 0; y < data.Y_SIZE; y++) { for (int z = 0; z < data.Z_SIZE; z++) { IBallController ball = BallCreator.GetBall(data.balls[x, y, z], SizeRatio, false); ball.Init(x, y, z, this); interior[x, y, z] = ball; } } } }
public override void SetData(BoardData data) { boardData = data; board = new BoardPosition[boardData.X_SIZE, boardData.Y_SIZE]; for (int x = 0; x < boardData.X_SIZE; x++) { for (int y = 0; y < boardData.Y_SIZE; y++) { Vector3 position = GetWorldPosition(x, y); TileController tile = TileCreator.CreateTile(boardData.tiles[x, y], position, SizeRatio); tile.transform.SetParent(transform, false); IBallController ball = BallCreator.GetBall(boardData.balls[x, y], SizeRatio); ball.Init(x, y, this); board[x, y] = new BoardPosition(tile, ball); } } }