Example #1
0
    private GameCube MakeCube(SeededRandom dice)
    {
        GameCube toReturn = GameObject.Instantiate(cube);

        toReturn.Initialize(owner, dice);
        return(toReturn);
    }
Example #2
0
    internal void DropNewCubeAt(int x, int y)
    {
        GameCube cube = GameObject.Instantiate <GameCube>(currentPiece.cube); // Probably unsafe.

        cube.Initialize(player, dice);
        grid[currentPiecePosition.x + x - 1, currentPiecePosition.y + y - 1] = cube;
        cube.transform.parent        = this.transform;
        cube.transform.localPosition = new Vector3(currentPiecePosition.x - numCells.x / 2f + x - 1 + .5f, 0, currentPiecePosition.y - numCells.y / 2f + y - 1 + .5f);
    }