public void RemovePiece(int yIndex, int xIndex) { Vector3 pos = new Vector3(xIndex * unitsPerSquare, 0, (7 - yIndex) * unitsPerSquare); GamePieceHelperClass helper = GamePieceHelperClass.gamePieceHelperClass; if (yIndex > 7 && player == 1) { if (GameManager.gameManager == null) { GameManagerSharedDevice.gameManagerSharedDevice.IncrementStoneCount(1); } else { GameManager.gameManager.IncrementStoneCount(1); } helper.ReturnPiece(pieceGameObject, pos); } else if (yIndex < 0 && player == 2) { if (GameManager.gameManager == null) { GameManagerSharedDevice.gameManagerSharedDevice.IncrementStoneCount(2); } else { GameManager.gameManager.IncrementStoneCount(2); } helper.ReturnPiece(pieceGameObject, pos); } else { helper.DeletePiece(pieceGameObject, pos); } }
private void Awake() { gamePieceHelperClass = this; }