Components

ChessGameBaseGUI Component

There are quite a few GUI components inherited from this components as their base class. However, only ChessPuzzleGUI and ChessPuzzleEditorGUI has different Inspector UI due to the nature of their game mode and usage.

Force Optional Draw - Should auto draw on threefold repetition and fifty-moves rule. When unticked, players have the option to decline such draw when it happens. Note that this option is useless even when it is ticked on ChessPGN scene as PGN text file imported from other places might not stops at threefold repetition or fifty-moves rule.

Has Graveyard - Should spawn graveyard tiles when the scene first loaded.

Start With Fen - If the game should start with fen when pieces are being first spawn to the board.

Fen String - The FEN(Forsyth-Edwards Notation) string being used to spawn pieces when Start With Fen toggle is ticked.

ChessPuzzleGUI(Inherited from ChessGameBaseGUI) Component

For puzzle game, all SerializedField are being hidden from inspector since Chess Puzzle Game does not need any of the options available like GUIs used for standard chess game does.

ChessPuzzleEditorGUI(Inherited from ChessGameBaseGUI) Component

The Inspector UI is written with custom editor script, please refer to Puzzle Editor page.

ChessObjectManager Component

A component required by GUI as it will provides all the GameObjects information

Is 3D - Whether the game should start with 3D, if unticked, the game will be started with 2D sprites.

Tiles Game Objects Section - Containing black and white tiles prefab, the formula to spawn them as a standard 8x8 chess tile pattern is used when game scene with scene gameobject attached with GUI component is loaded.

Graveyard Game Objects Section - The prefabs for black and white graveyard tiles, captured pieces will be placed on them if graveyard is enabled from GUI component.

Pieces 2D Game Objects Section - All 2D chess pieces prefabs, can be left empty if the game is only available in 3D.

Pieces 3D Game Objects Section - All 3D chess pieces prefabs, can be left empty if the game is only available in 2D.

Adjust Tiles Position Section - All tiles will be moved by the margin of the X,Y,Z axis set from the origin when the game scene first started.

Adjust Graveyard Position Section - :

The settings of whether to spawn graveyard tiles is on GUIs component

Space In Between - Whether the algorithm to calculate graveyard tiles position should use z-axis length of tile prefab or graveyard tile prefab as the difference. When ticked, Imagine that the algorithm is spawning white tiles instead of graveyard tiles and eventually replaced all those white tiles with graveyard tiles which ended up having spaces in between each of them as the white tile prefab has a wider z-axis than as of graveyard tile.

Graveyard Column/Row Start - The algorithm of spawning graveyard tiles is designed to be symmetrical, meaning spawning one graveyard tile at -1.5 x-axis will spawn another at 1.5 x-axis as well.

Graveyard Column/Row Count - How many column/row graveyard tiles should be spawned on each side, just give the number and the algorithm will do the work. The total number of tiles for a side(row x column) cannot be less than the possible number of capture made for the side on the game.

Camera Position Adjustment Section - These are preset camera position, the camera will be set at the exact position or auto adjusted when it is 2D/3D/3D that have graveyards.

ChessUIManager Component

You may noticed that most of the scenes have their UI scene game object set active even when it is not intended to be shown when game first started, unused UI can be set inactive directly. This is where Chess UI Manager component kick in to decide which UI should be showing and which is not depending on situation. The reasons all UI that's intended to be used during gameplay should be set active is because this package system need all scripts attached to UI prefabs(BaseUI subclassed scripts) to have their OnStart() method being called, setting them inactive would nullify that when the scene first loaded.

With this component, it is easier to switch the decision of which UI should be shown before start button is pressed or when the quit button is pressed.

Show On Start - When the start button is pressed, the UIs with the script attached will be set active but it will remain inactive before start button is pressed or when quit button is pressed.

Hide On Start - UIs in this list will remain active when the scene first loaded or when quit game button is pressed, but hidden otherwise.

Interactable On Start - Like Show On Start list, but instead of set active or inactive, it sets the UI interactability.

Non Interactable On Start - The exact opposite of Interactable On Start list.

Hide On Play - This list accept Game Object instead of (BaseUI subclassed scripts) attached to Game Object, Game Object in this list will directly being set inactive when scene first loaded. If this list is not used but instead of setting the game object inactive on scene, the OnStart() method will not get called when scene first loaded, just to repeat in case.

SoundEffectManager Component

Enable - No sound will be displayed whenever it is unticked and otherwise.

Chess Move Sound Effect - The sound effect when piece move from one tile to another.

Chess Attack Sound Effect - The sound effect when piece did make a capture while performing a move.

Checking Sound Effect - The sound effect when piece is checking the opponent king, this sound effect will be priorities over any others.

Check Mate Sound Effect - The sound effect when chess game result is provided, even when it's a draw. Should have changed it's name to Game Finished Sound Effect instead. This will stop all others sound effect from playing.

Tips : All of the sound effect object fields can be left blank without problems.

Last updated