Chess Game  1.1.0
A full chess game for Unity
cgBoardGeneratorScript Class Reference

Inherits MonoBehaviour.

Public Types

enum  Type {
  WhitePawn = 1, WhiteRook = 2, WhiteKnight = 3, WhiteBishop = 4,
  WhiteQueen = 5, WhiteKing = 6, Empty = 0, BlackPawn = -1,
  BlackRook = -2, BlackKnight = -3, BlackBishop = -4, BlackQueen = -5,
  BlackKing = -6
}
 All possible chess types. More...
 

Public Member Functions

void generate (List< sbyte > customPlacements=null)
 

Public Attributes

GameObject whiteSquarePrefab
 The prefab used when generating white squares. More...
 
GameObject blackSquarePrefab
 The prefab used when generating black squares. More...
 
GameObject piecePrefab
 The prefab used when generating pieces. More...
 
Vector2 squareSpacing = new Vector2(.6f, .6f)
 Determines the spacing of generated squares. More...
 
Vector2 squareScale = new Vector2(1f, 1f)
 Determines the scale of squares. More...
 
cgChessBoardScript boardScript
 The cgChessBoardScript. More...
 
byte boardWidth = 6
 The desired width of the generated board. More...
 
byte boardHeight = 7
 The desired height of the generated board. More...
 
bool use3d = false
 Should it be displayed as 3d? More...
 
Vector3 squareStartPoint = new Vector3(-2.2f,2.2f,0)
 The top left starting point of the board, where the first square is placed, dictating the placement of all following squares. More...
 
bool customizePlacements = false
 Do you want to customize placements(true)? Or cram the default positions onto your generated board(Note: if width is less that 5 no king will be placed). More...
 
Type [] piecePlacements
 The placement of pieces on the generated board. More...
 

Member Enumeration Documentation

◆ Type

All possible chess types.

Member Data Documentation

◆ blackSquarePrefab

GameObject cgBoardGeneratorScript.blackSquarePrefab

The prefab used when generating black squares.

◆ boardHeight

byte cgBoardGeneratorScript.boardHeight = 7

The desired height of the generated board.

◆ boardScript

cgChessBoardScript cgBoardGeneratorScript.boardScript

◆ boardWidth

byte cgBoardGeneratorScript.boardWidth = 6

The desired width of the generated board.

◆ customizePlacements

bool cgBoardGeneratorScript.customizePlacements = false

Do you want to customize placements(true)? Or cram the default positions onto your generated board(Note: if width is less that 5 no king will be placed).

◆ piecePlacements

Type [] cgBoardGeneratorScript.piecePlacements

The placement of pieces on the generated board.

◆ piecePrefab

GameObject cgBoardGeneratorScript.piecePrefab

The prefab used when generating pieces.

◆ squareScale

Vector2 cgBoardGeneratorScript.squareScale = new Vector2(1f, 1f)

Determines the scale of squares.

◆ squareSpacing

Vector2 cgBoardGeneratorScript.squareSpacing = new Vector2(.6f, .6f)

Determines the spacing of generated squares.

◆ squareStartPoint

Vector3 cgBoardGeneratorScript.squareStartPoint = new Vector3(-2.2f,2.2f,0)

The top left starting point of the board, where the first square is placed, dictating the placement of all following squares.

◆ use3d

bool cgBoardGeneratorScript.use3d = false

Should it be displayed as 3d?

◆ whiteSquarePrefab

GameObject cgBoardGeneratorScript.whiteSquarePrefab

The prefab used when generating white squares.


The documentation for this class was generated from the following file: